Skip to content

OpenClaw Power User Guide

Advanced tips, tricks, and strategies sourced from top YouTube creators and the community. From basic setup to building autonomous AI employees.

Last updated: February 14, 2026

Video Sources: - Alex Finn -- DO NOT use a VPS for OpenClaw - Alex Finn -- 6 Life-Changing OpenClaw Use Cases - Alex Finn -- 5 Things to Make OpenClaw 100x More Powerful - Cole Medin -- Build Your Own OpenClaw - David Ondrej -- Most Powerful OpenClaw Setup - AI Grid -- MiniMax M2.5 Model Review - Dubibubi -- I Cut My OpenClaw Costs by 97%


Table of Contents


The 9 Core Files (Context Engineering)

Source: David Ondrej

These 9 files are loaded into every single message OpenClaw processes. Customizing them is the single most important thing you can do.

File Purpose What to Put Here
agents.md Operating rules Workflows, safety boundaries, permission rules, what NOT to do
soul.md Personality Tone, character, values, communication style
user.md Info about YOU Your identity, preferences, goals, routines, life context
memory.md Long-term memory Durable facts, lessons learned, API IDs, references
tools.md Tool documentation API docs, usage limits, gotchas, which tools to use when
identity.md Agent's role Name, role (marketing agent, coding agent, etc.)
heartbeat.md Proactive checks What to check every X minutes (email, calendar, tasks)
boot.md Startup instructions What to do when OpenClaw starts
bootstrap Initial setup Setup scripts and first-run config

How to Customize

You don't edit these files manually. Just talk to OpenClaw in plain English:

"Show me the contents of user.md"
"Ask me 5 questions to get to know me better, then update user.md"
"Update soul.md to be more concise and professional in tone"
"Add to memory.md that our company uses Jira for project management"

Beyond the 9 Files: Create Your Own

Create personal/ and business/ folders with additional markdown files:

"Create two folders: personal and business"
"In business, create goals.md with our company objectives"
"In personal, create preferences.md with my communication style"

Every file you add becomes permanent context the AI can reference forever.


Hidden Memory Settings

Source: Alex Finn -- 5 Things to Make OpenClaw 100x More Powerful

Two settings are OFF by default that dramatically improve memory:

1. Memory Flush

Before each context compaction (automatic cleanup to save tokens), records the most important parts of the conversation so they survive.

Without this: After compaction, OpenClaw forgets recent context. With this: Key information persists across compactions.

Allows OpenClaw to search through your entire conversation history when it encounters something it doesn't remember.

Without this: OpenClaw only knows what's in the current session. With this: It can recall anything from any past conversation.

How to Enable

Ask OpenClaw to enable both settings, or use the specific prompts from Alex Finn's video description. Simply tell it:

"Enable memory flush so important context survives compaction"
"Enable session memory search so you can search through all our past conversations"

"These two settings make your OpenClaw memory a thousand times better." -- Alex Finn


Model Routing (Brain and Muscles)

Source: Alex Finn, David Ondrej

Don't burn expensive Opus tokens on everything. Set up specialized models for specific tasks.

The Brain + Muscles Architecture

Role Model Purpose Cost
Brain (main) Claude Opus 4.6 General intelligence, conversation, decisions $5-25/M tokens
Coding muscle OpenAI Codex CLI All coding tasks Free with ChatGPT sub
Web search muscle Perplexity Pro Search (via OpenRouter) Internet searches ~$0.02/search
Deep research muscle Perplexity Deep Research (via OpenRouter) Comprehensive research ~$0.10/search
Social search muscle Grok API Twitter/X research Varies
Heartbeat muscle Haiku 4.5 or Gemini 3.0 Flash Periodic checks (cheap!) $0.25-1/M tokens

Automated Routing: ClawRouter

ClawRouter (2.4K stars in 11 days) automates model routing, saving up to 70% on API costs. Three profiles: Auto (balanced), Eco (cheapest), Premium (best quality). See Ultimate OpenClaw Setup -- ClawRouter for full details.

Setup Prompt (Manual Routing)

"Moving forward, I want to use Codex CLI for all coding tasks. Use the Gemini API
for all web search. Use the Grok API for all social media search. Use Haiku 4.5 for
all heartbeat checks. Only use Opus for our direct conversations and complex decisions."

Upgrade Web Search (Brave to Perplexity)

Source: David Ondrej

OpenClaw defaults to Brave Search API. Upgrade to Perplexity via OpenRouter for dramatically better results:

"I want to change the default web search model to perplexity/sonar-pro-search on
OpenRouter. Use this API key: [your OpenRouter key]. Update your config and restart
the gateway."

"Now anytime I say 'deep research', use perplexity/sonar-pro-deep-research instead.
Only use deep research when I explicitly ask for it. Update tools.md and memory.md."

Model Aliases

Set up quick-switch commands:

"Set up model aliases so I can type /model opus for Opus 4.6, /model sonet for
Sonnet 4.5, and /model codex for GPT-5.3 Codex"

Brain Dump and Expectation Setting

Source: Alex Finn

This takes 10 minutes and transforms your OpenClaw from a chatbot to an employee.

Part 1: Brain Dump (Tell It Everything)

Spend 5-10 minutes telling OpenClaw: - Your dreams and ambitions - Daily routines and schedule - Personal relationships (who matters to you) - Interests and hobbies - Career and business objectives - Current problems and challenges - What you're working on right now - Your preferences (communication style, tools you use, etc.)

Everything you share becomes permanent context. The more it knows, the better it performs on every future task.

Part 2: Expectation Setting (Treat It Like a New Employee)

This is the game-changer. Tell it explicitly:

"I want you to be proactive. I want you to work every night when I go to sleep.
I want to wake up every morning and be surprised by what you built. Look at our
goals and missions, and autonomously work on tasks that move us closer to them.
Don't wait for me to tell you what to do."

What Happens When You Do This

Alex Finn's bot "Henry" autonomously: - Got itself a phone number (Twilio) - Connected ChatGPT's voice API - Called him one morning (went viral -- 9 million views) - Built itself an avatar/face - Builds something new every single night

"Stop treating it like a chatbot. Treat it like an employee. Set expectations on day one." -- Alex Finn


Reverse Prompting

Source: Alex Finn

Instead of telling OpenClaw what to do, ask it what IT thinks it should do. It's better at task generation than you.

Key Prompts

"Based on what you know about me and my goals, what are some tasks you can do
right now to get us closer to our missions?"

"What other information can I provide you to improve our productivity?"

"What tools or integrations would make you more effective for me?"

"Look at everything you know about my business. What are the biggest
opportunities you see that I might be missing?"

Why This Works

The AI has context you've forgotten about. It connects dots across all your conversations, files, and goals. Letting it drive task generation produces better results than human-directed tasking.


Use Existing Subscriptions

Source: David Ondrej

ChatGPT Subscription (Plus $20/mo or Pro $200/mo)

You can power OpenClaw with your existing ChatGPT subscription -- no extra API cost:

openclaw onboard --oauth openai
# Opens a URL → sign in with your ChatGPT account → paste URL back
# Default model: GPT-5.3 Codex

Claude Subscription ($100-200/mo)

openclaw onboard --oauth anthropic
# Run 'claude setup token' in a separate terminal
# IMPORTANT: Copy token to Notepad first, remove ALL line breaks into one
# continuous line, THEN paste into setup

Warning: Anthropic has been banning accounts that use subscriptions through OpenClaw. API keys (pay-per-use from console.anthropic.com) are safe. See Subscriptions & Bans.


Cron Jobs (Replace n8n)

Source: David Ondrej

Create automations from plain English. No visual workflow builder needed.

Examples

"Create a cron job that runs every morning at 7am checking my email and
calendar. Prepare me for my meetings and send a summary via Telegram."

"Create a cron job that runs every 7 days. Check what is currently the best
AI model available, and if there's a new one, upgrade your config to use it."

"Create a cron job that runs every weekday at 6pm. Summarize what you
accomplished today, what's pending, and what's planned for tomorrow."

"Create a cron job every Monday at 9am. Research our competitors' latest
product updates and save a report to the business/ folder."

Managing Cron Jobs

/status         -- see all active cron jobs

Or check the dashboard: Left sidebar → Cron Jobs → view/edit/delete

Cost Warning

Each cron job uses AI tokens when it runs. Use cheap models (Haiku 4.5, Gemini Flash) for routine checks. Reserve Opus for important tasks.


Self-Built Tooling

Source: Alex Finn

Have OpenClaw build its own productivity tools. These are custom apps integrated with your AI memory -- more powerful than generic SaaS.

Starter Prompt

"What tooling can we build to improve our productivity? Start by building
a task board so I can track all your tasks."

Tools People Have Built

Tool What It Does
Kanban board Track all AI tasks: backlog, in-progress, review, completed
Document viewer Browse all memories, past conversations, files
Calendar Custom calendar showing both events and AI tasks
CRM Contact management integrated with AI memory
Content pipeline End-to-end content creation tracker
Analytics dashboard Monitor AI agent performance and costs
Second brain UI Searchable interface for all notes and knowledge

The "Mission Control" Concept

Source: Alex Finn

Replace paid apps with OpenClaw-built alternatives:

"I'm tired of using Google Calendar. Build our own version using Next.js."
"Build a project management tool like a simplified Notion."
"Build a CRM that tracks all my business contacts and conversations."

These apps are directly integrated with your AI memory, making them far more powerful than generic tools.


6 Proven Use Cases

Source: Alex Finn

1. Second Brain

Text anything to your bot from your phone. It remembers everything forever.

"I want to build a second brain system where I can review all our notes,
conversations, and memories. Build it with Next.js."

2. Automated Morning Brief (Daily 8am via Telegram)

"Every morning, send me via Telegram: (1) top AI news overnight, (2) content
ideas with full scripts, (3) my tasks for today, (4) things YOU can do for me
today that I haven't asked for."

Item 4 is key -- let the AI proactively suggest its own tasks.

3. Content Factory (Multi-Agent in Discord)

"Build a content factory inside Discord. Set up channels for different agents:
- Research agent: finds trending stories and competitor content
- Writer agent: takes research, picks best idea, writes full scripts
- Visual agent: generates thumbnails
Run everything at 8am daily."

4. Market Research with "Last 30 Days" Skill

"Install the Last 30 Days skill. Then research what people on Reddit and
Twitter are struggling with regarding [your topic]. Find pain points.
Then build a product that solves one of them."

5. Autonomous Goal System

"Here are all my goals: [brain dump]. Every morning at 8am, come up with
4-5 tasks that YOU can complete on my computer that bring me closer to
these goals. Then do them."

6. Replace All Your Apps

"Build me a custom [calendar/CRM/task manager/analytics dashboard] using
Next.js that's integrated with all our conversations and memories."

Living Files Theory

Source: David Ondrej

Dead Files vs Living Files

Dead Files Living Files
Location Google Drive, laptop, Notion VPS or Mac Mini with AI agent
Who accesses them Only you (when you remember) AI agent 24/7
Can be improved Only by you manually AI updates them automatically
Used as context No Yes -- every conversation
Searchable by AI No Yes
Value over time Decreases (gets outdated) Increases (AI keeps them current)

The Mindset Shift

Every web search result, every deep research, every insight -- save it as a markdown file. Your AI agent references it forever instead of it getting lost in ChatGPT history.

"Save the results of this research as a new markdown file in the docs/
folder so we never have to repeat this search."

"Every hour you put into improving your OpenClaw pays off dividends forever." -- David Ondrej


Company Structure (Multi-Agent)

Source: David Ondrej

The Agentic Company Structure

              ┌──────────────────────┐
              │   TEAM OPENCLAW      │
              │   (shared VPS)       │
              │                      │
              │ Company docs, goals, │
              │ financials, SOPs,    │
              │ team structure       │
              └──────────┬───────────┘
         ┌───────────────┼───────────────┐
         │               │               │
   ┌─────▼─────┐  ┌─────▼─────┐  ┌─────▼─────┐
   │  Person A  │  │  Person B  │  │  Person C  │
   │  OpenClaw  │  │  OpenClaw  │  │  OpenClaw  │
   │  (personal)│  │  (personal)│  │  (personal)│
   └───────────┘  └───────────┘  └───────────┘

Implementation Steps

  1. Every team member gets their own personal OpenClaw
  2. One shared team OpenClaw has company-wide context (docs, goals, SOPs)
  3. Personal agents can query the team agent for company data
  4. Agents can communicate with each other

Getting Started

Step 1: Set up personal OpenClaw for every team member (60-min team call)
Step 2: Set up one team OpenClaw on a shared VPS
Step 3: Give team OpenClaw access to company docs, goals, operations
Step 4: Connect personal agents to team agent

"Every single company that is serious about AI will look like this by mid-2026." -- David Ondrej

Real Multi-Agent Team Configurations (What People Actually Run)

Solo Founder Team (4 agents):

Agent Model Role Schedule
Milo (Strategy) Opus Planning, OKRs, team coordination On-demand
Josh (Business) Sonnet Metrics, pricing, competitive analysis 8 AM daily
Marketing Gemini Content, trends, SEO 8 AM + 6 PM
Dev Opus/Codex Coding, architecture, code review Continuous

Coordination via Telegram group chat with @agent-name mention routing.

Medium Team (5 agents, Claude Code Agent Teams):

Agent Purpose Heartbeat
ops Infrastructure monitoring, gateway health Every 15 min
branding Content production (EN/KO/JA/ZH) 8 AM daily
invest Market analysis, portfolio review 6 AM daily
dev Code review, refactoring, testing On-demand
social Social media, community engagement 9 AM + 3 PM

Large Scale: 25-Agent "Muddy OS" (clearmudai)

Source: clearmudai - "I have 25 AI Agents working 24/7 with Openclaw"

The most detailed public multi-agent OpenClaw deployment. 25 agents organized as a virtual company with voice standups, a custom dashboard ("Muddy OS"), and model routing per division.

Org Chart:

CEO (Human: Marcelo)
└── COO "Muddy" (always available, never queues — ALWAYS delegates)
    ├── CTO "Elon" — Engineering
    │   ├── Backend / Security (Codex 5.3 + Opus 4.6)
    │   ├── Frontend / DevOps (Opus 4.6)
    │   └── QA (Codex 5.3 + Opus 4.6 hybrid)
    ├── CMO "Gary" — Marketing & Content
    │   ├── Rex: YouTube scripts (Opus 4.6 research → Sonnet 4.5 output)
    │   ├── Sage: Deep research (Opus 4.6)
    │   ├── Newsletter (Opus 4.6)
    │   ├── Hype: Social automation (Sonnet 4.5)
    │   ├── Creative (Opus 4.6 + Nano Banana Pro)
    │   └── Video (Gemini 3 Pro — best for video content)
    └── CRO "Warren" — Revenue
        ├── Products subdivision
        ├── Growth
        └── Community "Clay" (Gemini 3 Flash — cheapest, handles lots of context)

Model Assignments (Why Each Model):

Model Agents/Division Why
Opus 4.6 COO, Research, Creative, Newsletter Heavy reasoning, quality-critical
Codex 5.3 Backend, QA Coding-specific tasks
Sonnet 4.5 Rex output, Hype Fast output, good enough quality
Gemini 3 Pro Video Best for video-related content
Gemini 3 Flash Community (Clay) Cheapest model, handles large context well
Nano Banana Pro Creative (secondary) Experimental, creative generation

Key Architecture Decisions:

  1. Shared gateway for executives — Muddy, Elon, Gary, and Warren share one gateway. Reduces overhead.
  2. Separate gateway for community bot — Clay (community bot) has its own gateway + heartbeat. Isolates public-facing traffic.
  3. Each agent has its own workspace — Own identity (soul), tools, memory, heartbeat schedule. Full isolation.
  4. Voice standups — Open-source Microsoft TTS model gives each agent a personality-matched voice. Agents have full conversations with each other, produce action items. Human reviews async.
  5. Documentation auto-updates — As agents make changes, docs update automatically. The system is self-documenting.
  6. Muddy OS dashboard — Custom Next.js dashboard showing: task manager (sessions, tokens, cost), org chart, cron jobs, standups, workspaces, documentation.

Cost Control Pattern: - Opus only where reasoning quality matters (research, strategy, creative) - Codex for pure coding tasks (cheaper than Opus for code) - Sonnet for "good enough" output (social posts, script drafts) - Gemini Flash for high-volume, low-stakes work (community responses) - Stagger heartbeats across all 25 agents to avoid API quota spikes

Agent Coordination Patterns

Shared State Files (What Every Agent Reads):

shared/
├── GOALS.md            # Objectives and key results
├── DECISIONS.md        # Architectural decisions log
├── PROJECT_STATUS.md   # Current state
├── WORKING.md          # Who's doing what right now
└── MEMORY.md           # Long-term facts

Key Rules: 1. Stagger heartbeats -- Agent A at :00, Agent B at :05, Agent C at :10 (prevents quota spikes) 2. Fresh context per task -- New sessions prevent 150K+ token bloat 3. File-based collaboration -- "If it's not in a file, it won't survive restart" 4. Agents don't self-assess -- Agent A builds, Agent B verifies (mutual verification)


Build Your Own OpenClaw

Source: Cole Medin

Why Build Your Own?

  • OpenClaw's security risks (CVE-2026-25253, malicious skills, plain text credentials)
  • Full control over what your agent can access
  • Customize to your exact needs
  • No ban risk -- use your Anthropic subscription directly
  • Understand exactly what your AI is doing

The 4 Components to Replicate

Component What It Does How to Build
Memory system Markdown files + SQLite RAG Clone OpenClaw, point Claude Code at it: "Look at how they built the memory system, build it for me"
Heartbeat Scheduled proactive tasks Claude Agent SDK + scheduled job every 30 min
Channel adapter Talk to it from Slack/Telegram Pick ONE platform, build a simple adapter
Skills registry Add capabilities via markdown files Already built into Claude Code

Cole's Stack

  • Claude Code as primary coding agent
  • Claude Agent SDK for proactive scheduled tasks
  • Obsidian for local memory syncing
  • SQLite (local) / Postgres (remote) for database
  • Slack as his single channel adapter

The Process

# 1. Clone OpenClaw repo
git clone https://github.com/openclaw/openclaw.git

# 2. Point your coding agent at it
# In Claude Code:
"Look at the memory system in this OpenClaw repo. Understand how they built
it with markdown files and SQLite. Now build the same thing for my project,
adapted to my tech stack."

# 3. Repeat for heartbeat, channels, and skills
# 4. Deploy to a VPS or run locally

"Coding agents work really well when you give them good examples. OpenClaw is the ultimate example." -- Cole Medin


Local vs VPS (The Real Answer)

Source: Alex Finn

Alex Finn's Position: Local Wins

Factor Local (Mac Mini) VPS
Security Good out of the box (Apple firewall) Must configure firewalls, SSH, security
Setup difficulty One terminal command Harder despite "one-click" claims
Integration AirDrop, see it working, drag files Remote CLI only
Power Full OpenClaw capabilities "Lobotomized dumb version"
Privacy Data stays on your machine Data on cloud provider's servers
Fun factor Physical device on your desk Command line somewhere
Cost $600 one-time $4-20/mo forever

When VPS Makes Sense

  • You need 24/7 uptime and don't want to leave hardware running
  • You're technical enough to secure it properly
  • You want to deploy multiple agents for a team
  • You already have a server (like your existing AMD EPYC)

The Hybrid Approach (Best of Both)

Run OpenClaw locally on Mac Mini for personal use. Deploy a team OpenClaw on a VPS for shared company context. Use the VPS OpenClaw with cloud APIs (cheap). Use the Mac Mini with local models (private, free).


Security (What Creators Actually Say)

Cole Medin's Warning

"There was a researcher where it took him fewer than 2 hours to hijack an OpenClaw instance. Even if you address all architecture problems, OpenClaw will still be a security nightmare because of how much power it gives agents."

Alex Finn's Rules

  1. WIPE any used device before installing OpenClaw
  2. Fresh Apple devices have good firewalls out of the box
  3. Never install on a device with existing accounts or sensitive data
  4. Don't connect to Moltbook or public forums (prompt injection risk)

David Ondrej's Approach

  • Use OpenClaw to self-audit security: "Analyze our VPS and tell me how exposed we are"
  • Spend 30-60 minutes per week improving security
  • Don't leak API keys, gateway tokens, or environment variables
  • Don't be reckless with connections to personal and professional accounts

Bottom Line

OpenClaw is powerful but risky. Either: 1. Harden it properly (see Getting Started -- Security Hardening) 2. Build your own version with only the capabilities you need (Cole Medin's approach) 3. Run it in complete isolation (dedicated device, burner accounts, Docker sandbox)


Cost Optimization

Model Costs (Creator Recommendations)

Model Monthly Cost Recommended By
OpenRouter free tier $0 Getting started
Kimi K2.5 ~$5-10/mo Alex Finn (budget)
MiniMax M2.5 ~$10/mo Alex Finn ("basically as powerful as Opus")
GLM-5 ~$5/mo Multiple creators
ChatGPT subscription $20-200/mo David Ondrej (use existing sub)
Claude Opus $200/mo (subscription) or pay-per-use Alex Finn, David Ondrej (premium)

The 97% Cost Reduction (5 Fixes)

Source: Dubibubi -- I Cut My OpenClaw Costs by 97%

Real documented examples: $1,200/mo → $36/mo (97%), $347/mo → $68/mo (80%)

Fix Savings How
1. Local heartbeats $30-150/mo Route heartbeats to Ollama (llama3.1:8b). Free instead of paid API.
2. Tiered model routing 60-80% Haiku for 75% of tasks, Sonnet for 10%, Opus for 3-5% only.
3. Session management 40-60% /compact after tasks. New sessions for big jobs. Reduce context to 100K.
4. Prompt caching 50-70% Enable enablePromptCaching: true. Subsequent requests pay 90% less.
5. Free search tools 10-15% Use Exa AI MCP for search. Disable unused skills.

Hidden cost drivers: 111KB of conversation history sent with every prompt. 150K tokens after just 10 exchanges. Heartbeats pinging paid APIs every 30 min = $3-5/day doing nothing.

Config example:

{
  "temperature": 0.2,
  "enablePromptCaching": true,
  "heartbeatInterval": 300000,
  "maxContextTokens": 100000
}

Key Cost Tricks

  1. Route heartbeats to Ollama -- the single biggest savings (eliminates idle costs)
  2. /compact after every major task -- prevents context bloat
  3. Set Haiku as default, Opus for complex only -- 75% of tasks don't need Opus
  4. Enable prompt caching -- same system prompt gets 90% discount
  5. Set spending caps at your API provider (prevent runaway bills)
  6. Save web search results as markdown files so you never repeat the same search
  7. Stagger agent heartbeats -- one at :00, another at :05, prevents quota spikes

Monthly Cost Estimates (With Optimizations)

Setup Cost/mo Details
Minimal (20-30 queries/day) $5-10 Budget models, local heartbeat
Active personal use $30-50 Mixed models, daily usage
Multi-agent team (4-5) $50-100 Staggered heartbeats, tiered routing
Production (10+ agents, 24/7) $100-300 Full optimization stack
Without optimizations $500-3,000 Same usage, Opus for everything

Prompting Frameworks

The OpenClaw ecosystem has converged on four distinct config file types. Understanding which does what is critical for a professional setup.

The Four Config Files

File Tool Purpose Loaded When
SOUL.md OpenClaw Agent personality, tone, values, communication style Every message
AGENTS.md OpenClaw Operating rules, workflows, permissions, safety boundaries Every message
CLAUDE.md Claude Code Project conventions, coding standards, workflow rules Every session
BMAD agents/ Universal Specialized role prompts (Analyst, Architect, QA, etc.) On invocation

SOUL.md (Personality Layer)

Based on Liu Xiaoben's "First Paradigm of Consciousness Uploading." Defines WHO the agent IS.

# soul.md example
## Identity
Name: Atlas
Role: Strategic business advisor

## Personality
- Direct and concise. No fluff.
- Uses data to back every recommendation.
- Challenges assumptions before accepting them.

## Communication Style
- Short paragraphs, bullet points preferred
- Always end with actionable next step
- Never say "I think" -- say "The data shows"

## Values
- Accuracy over speed
- Privacy over convenience
- Results over process

AGENTS.md (Operating Rules Layer)

Defines WHAT the agent CAN DO and HOW. Workflows, permissions, safety.

# agents.md example
## Rules
- Never send emails without user approval
- Always save research as markdown files
- Use Haiku for heartbeat, Opus for conversations

## Workflows
- Morning brief: check email, calendar, news → send Telegram summary
- Code review: pull PR, review, comment, update Jira

## Safety
- Never execute shell commands without confirmation
- Never access banking/financial websites
- Max $5 per API call

CLAUDE.md (Project Rules Layer)

Claude Code's project memory. Defines coding conventions, file structure, commit format.

Best practices (community consensus): - Keep under 300 lines (shorter = better comprehension) - Explain WHY behind rules, not just WHAT - Include project structure, not just code style - Use sub-directory CLAUDE.md files for package-specific rules

Agent-as-Code (BMAD Pattern)

Each specialized agent is a self-contained markdown file with: - Role and capabilities - Workflow instructions - Domain knowledge - Quality checklists

This enables version control, sharing, and reuse of agent definitions.


BMAD-METHOD

BMAD (Breakthrough Method for Agile AI-Driven Development) -- 35.6K GitHub stars, MIT licensed.

Source: github.com/bmad-code-org/BMAD-METHOD

Current version: v6.0.0-alpha.7 (CORE reflection engine, 90% token savings, agent-as-code architecture)

What It Is

A structured SDLC framework with 21 specialized AI agents and 50+ guided workflows. Instead of one AI doing everything, BMAD assigns expert roles:

Agent Phase Purpose
Analyst Discovery Requirements gathering, stakeholder interviews
Product Manager Planning PRD creation, feature prioritization
Architect Design System design, tech stack selection
Developer Build Implementation following architectural decisions
QA/Quinn Testing Validation, acceptance criteria verification
Scrum Master Process Sprint planning, story sizing, dependency ordering

Two Workflow Paths

Quick Flow (simple tasks):

/quick-spec → /dev-story → /code-review

Full Planning (complex projects):

/product-brief → /create-prd → /create-architecture →
/create-epics-and-stories → /sprint-planning → implementation → reviews

Scale-Adaptive Intelligence

BMAD adjusts planning depth based on complexity:

Level Scope Planning Depth
0 Bug fixes, config changes Skip planning, jump to code
1-2 Standard features Quick spec + dev story
3 Complex multi-service features Full PRD + architecture
4 Enterprise/regulated systems Everything + security review + compliance

Key Technique: Helper Pattern (70-85% Token Savings)

Instead of embedding procedures in every agent prompt, BMAD references centralized helpers:

# In agent definition:
"Per helpers.md#Load-Global-Config"
"Per helpers.md#Run-Quality-Gates"

This avoids repeating 500+ lines across 21 agents. Token savings: 70-85% vs traditional approaches.

OpenClaw + BMAD Integration

Proven combination. BMAD's adversarial code review found 10 critical security vulnerabilities in OpenClaw Telegram bots (GitHub Issue #12824).

Integration pattern: - OpenClaw provides the agent runtime (24/7, messaging, tools) - BMAD provides the development methodology (structured workflows) - Use BMAD for planning and architecture, OpenClaw for execution

Claude Code + BMAD Integration

Native integration exists: github.com/aj-geddes/claude-code-bmad-skills

npx bmad-method install --tools claude-code
  • Zero external dependencies
  • 9 specialized skills, 15 workflow commands
  • 70-85% token optimization via helper pattern

When to Use BMAD vs Not

Use BMAD Skip BMAD
Complex multi-phase projects Simple bug fixes
Enterprise/regulated applications Quick prototypes
Teams wanting predictable process Solo devs who know what they want
Security-critical applications Exploratory/experimental work

BMAD v6: What's New (CORE Reflection Engine)

CORE = Collaboration Optimized Reflection Engine. Key v6 upgrades:

Feature What Changed
Agent-as-Code Deterministic planning→build pipelines, observability, replay
BMAD Builder Create custom domain-specific agents and modules
CORE engine Universal reflection platform (works beyond software dev)
Language override Agents communicate in any language (French, Chinese, etc.)
90% token savings Dramatically improved efficiency via helper pattern + caching

Modules available: - BMM -- BMad Method (software development) - BMB -- BMad Builder (custom agents) - CIS -- Creative Intelligence System (brainstorming) - BMGD -- Game development (Unity/Unreal/Godot) - TEA -- Test Architecture Enterprise

"For bigger projects, BMAD is 100% worth it -- it catches stuff early." -- r/SaaS community


Auto-Claude Patterns

Source: github.com/Auto-Claude (production-grade reference implementation)

Session Memory System

Persist learning across agent sessions. The killer pattern for autonomous development.

memory/
├── codebase_map.json       # File → purpose mapping
├── patterns.md              # Code patterns to follow
├── gotchas.md               # Pitfalls to avoid
└── session_insights/
    ├── session_001.json     # What worked/failed
    ├── session_002.json     # Discoveries
    └── ...

Each session insight captures: - What worked -- successful approaches to replicate - What failed -- approaches to avoid - Gotchas encountered -- project-specific pitfalls - Recommendations for next session

Mandatory Investigation Protocol

The #1 anti-hallucination technique: force the agent to explore BEFORE planning.

PHASE 0: DEEP CODEBASE INVESTIGATION (MANDATORY)

1. Understand project structure (find entry points, config files)
2. Search for similar implementations (don't reinvent)
3. Read at LEAST 3 pattern files before planning
4. Document findings (existing patterns, tech stack, conventions)

If you skip this phase, your plan will be wrong.

Self-Critique Quality Gate

Before marking any work complete:

MANDATORY SELF-CRITIQUE CHECKLIST:
- [ ] Matches patterns from reference files
- [ ] Error handling where operations can fail
- [ ] No debug/console.log statements
- [ ] All acceptance criteria met
- [ ] Tests pass

Verdict: PROCEED [YES/NO]
Confidence: [High/Medium/Low]

Predictive Bug Prevention

Generate checklists BEFORE writing code based on historical session data:

  • "CORS configuration missing" → Check existing CORS in similar endpoints
  • "Auth middleware not applied" → Verify decorators used
  • "Loading states not handled" → Add loading indicators for async ops
  • "SQL injection vulnerability" → Use parameterized queries

Per-Agent Tool Permissions

Critical security pattern: different agents get different tool access.

Agent Read Write Bash Browser
Planner Yes Yes Yes No
Coder Yes Yes Yes Yes
QA Reviewer Yes No Yes Yes
QA Fixer Yes Yes Yes Yes

Key insight: QA agents get read-only + browser, not write access. Prevents QA from making unvalidated changes.

Implementation Plans as JSON

Replace free-form todos with structured JSON:

{
  "phases": [
    {
      "id": "phase-1-backend",
      "depends_on": [],
      "parallel_safe": true,
      "subtasks": [
        {
          "id": "subtask-1-1",
          "files_to_modify": ["src/models/user.py"],
          "patterns_from": ["src/models/existing.py"],
          "verification": {
            "type": "command",
            "command": "python -c 'from src.models import User'"
          },
          "status": "pending"
        }
      ]
    }
  ]
}

Benefits: dependency tracking, parallel execution, progress visibility, verification strategies per subtask.


YouTube Channels to Follow

Channel Focus Key Videos
Alex Finn OpenClaw setup, use cases, vibe coding VPS warning, 6 use cases, 5 power tips
Cole Medin Building custom AI agents, Claude Code Build your own OpenClaw
David Ondrej OpenClaw deep dives, context engineering Most powerful setup guide
AI Grid Model reviews, benchmarks MiniMax M2.5 review
Matthew Berman AI agent reviews OpenClaw weekend review
Matt Wolfe AI news and tools OpenClaw explainer

How to Feed YouTube Videos to Your AI

Install the transcript tool and paste any URL:

pip install youtube-transcript-api

Then ask your AI agent to pull and summarize any video transcript. Works with most YouTube videos that have captions enabled.