Claude Code SOP
Claude Code SOP — Agent Orchestration Guide
Section titled “Claude Code SOP — Agent Orchestration Guide”Version: 2 (2026-02-21) | Claude Code: v2.1.50 | Auth: Anthropic subscription (not API key)
Overview
Section titled “Overview”Claude Code is a full coding agent CLI with file editing, bash execution, subagents, skills, and multi-agent teams. It’s superior to sessions_spawn for serious builds because it iterates on errors, explores codebases, and coordinates multi-file changes.
Three Modes of Operation
Section titled “Three Modes of Operation”Mode 1: Plan → Execute (RECOMMENDED for builds)
Section titled “Mode 1: Plan → Execute (RECOMMENDED for builds)”Phase 1 — Plan (read-only analysis):
cd /path/to/projectclaude -p --permission-mode acceptEdits --model sonnet --max-budget-usd 1 \ "Analyze the codebase. Create a detailed plan in PLAN.md. Be specific: file paths, component names, exact changes. ONLY create PLAN.md, do NOT modify existing files."Phase 2 — Execute (full permissions, batched):
claude -p --dangerously-skip-permissions --model sonnet --max-budget-usd 3 \ "Read PLAN.md. Execute items 1-5. Run 'npm run build' after. Fix errors. Commit. Do NOT ask questions. Just execute."CRITICAL: Break large plans into batches of 5–7 items per run. 14+ items in one run risks hitting the 10-min timeout.
Mode 2: Stream-JSON Interactive (for monitoring + steering)
Section titled “Mode 2: Stream-JSON Interactive (for monitoring + steering)”claude -p \ --input-format stream-json \ --output-format stream-json \ --verbose \ --dangerously-skip-permissions \ --model sonnetReceives NDJSON events on stdout (tool calls, thinking, results). Accepts NDJSON messages on stdin for follow-up instructions. Best used from tmux or a persistent shell.
Mode 3: Agent Teams (parallel workers)
Section titled “Mode 3: Agent Teams (parallel workers)”CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 claude --teammate-mode tmux \ --dangerously-skip-permissions --model sonnet \ "Build X and Y in parallel. See PLAN.md."Spawns team lead + parallel teammates in tmux panes. Max 5 agents. Requires: tmux installed, CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1.
Mandatory Rules
Section titled “Mandatory Rules”- Project must be a git repo —
git initif needed. Claude Code requires it. - Always include “Do NOT ask questions” — In
-pmode, questions cause it to exit without doing work. - Always include build/verify step — “Run npm run build and fix any errors.”
- Always include commit step — “Commit with message ‘X’.” Protects work from being lost.
- Batch large tasks — Max 5–7 items per
-prun. 10+ items risk timeout. - Set
--max-budget-usd— Prevents runaway costs. $3–5 per batch. - Set timeout to 600s — Claude Code needs time for multi-file work.
- Monitor progress — Check
git diff --statduring runs to see what’s changing. - Update the user every 10 min — Never go silent on long-running tasks.
Available Skills
Section titled “Available Skills”| Skill | When to Use |
|---|---|
superpowers:brainstorming | Before any creative/design work |
superpowers:writing-plans | Creating implementation plans |
superpowers:executing-plans | Executing a written plan |
superpowers:dispatching-parallel-agents | 2+ independent tasks |
superpowers:subagent-driven-development | Multi-task execution |
superpowers:systematic-debugging | Bug investigation |
superpowers:test-driven-development | TDD workflow |
superpowers:verification-before-completion | QA before marking done |
frontend-design:frontend-design | UI/UX design work |
Available Agents
Section titled “Available Agents”| Agent | Model | Purpose |
|---|---|---|
Explore | haiku | Cheap codebase exploration |
Plan | inherit | Read-only planning |
feature-dev:code-architect | sonnet | Architecture design |
superpowers:code-reviewer | inherit | Code review |
Key Flags Reference
Section titled “Key Flags Reference”| Flag | Purpose |
|---|---|
-p / --print | Non-interactive, exit after response |
--permission-mode plan | Read-only |
--permission-mode acceptEdits | Auto-approve edits, prompt bash |
--dangerously-skip-permissions | Full auto, no prompts |
--model sonnet / --model opus | Model selection |
--max-budget-usd <n> | Cost cap |
-c / --continue | Resume last session in this dir |
--append-system-prompt | Add custom instructions |
--agent <name> | Use a named agent |
--teammate-mode tmux | Multi-agent teams |
-w / --worktree [name] | Git worktree for isolation |
Claude Code vs sessions_spawn
Section titled “Claude Code vs sessions_spawn”| Aspect | Claude Code | sessions_spawn |
|---|---|---|
| Interactive control | Full (can iterate) | One-shot only |
| Codebase awareness | Automatic | Must include in prompt |
| Error recovery | Iterates on failures | Must respawn |
| Multi-file coordination | Excellent | Hit or miss |
| Cost | Anthropic sub (rate-limited) | Provider API |
| Reliability | High (local process) | Announce can be missed |
Use Claude Code for: Builds, refactors, multi-file features, anything that needs iteration. Use sessions_spawn for: Quick one-off tasks, research, non-coding work.
Standard Invocations
Section titled “Standard Invocations”Agent teams (parallel/complex work):
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 claude \ --teammate-mode tmux \ --dangerously-skip-permissions \ --model <opus|sonnet per scope> \ --max-budget-usd 5 \ -p "Task brief. Use subagent-driven-development skill for parallel work. Use verification-before-completion skill before finishing. Use jCodeMunch MCP for code navigation (search_symbols, get_symbol, get_file_outline). Index with index_folder first if not already indexed. Do not read entire files. Commit. Do NOT ask questions."Simple single-agent:
claude -p --dangerously-skip-permissions --model <model> --max-budget-usd 3 \ "Task brief. Use verification-before-completion skill before finishing. Use jCodeMunch MCP for code navigation. Index with index_folder first. Do not read entire files. Commit. Do NOT ask questions."See Also
Section titled “See Also”- Spawn SOP — Full sessions_spawn reference
- Model Catalog — Which model to use
- Checkpoints — Checkpoint protocol