Skip to content

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)

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.

Section titled “Mode 1: Plan → Execute (RECOMMENDED for builds)”

Phase 1 — Plan (read-only analysis):

Terminal window
cd /path/to/project
claude -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):

Terminal window
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)”
Terminal window
claude -p \
--input-format stream-json \
--output-format stream-json \
--verbose \
--dangerously-skip-permissions \
--model sonnet

Receives 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.

Terminal window
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.

  1. Project must be a git repogit init if needed. Claude Code requires it.
  2. Always include “Do NOT ask questions” — In -p mode, questions cause it to exit without doing work.
  3. Always include build/verify step — “Run npm run build and fix any errors.”
  4. Always include commit step — “Commit with message ‘X’.” Protects work from being lost.
  5. Batch large tasks — Max 5–7 items per -p run. 10+ items risk timeout.
  6. Set --max-budget-usd — Prevents runaway costs. $3–5 per batch.
  7. Set timeout to 600s — Claude Code needs time for multi-file work.
  8. Monitor progress — Check git diff --stat during runs to see what’s changing.
  9. Update the user every 10 min — Never go silent on long-running tasks.
SkillWhen to Use
superpowers:brainstormingBefore any creative/design work
superpowers:writing-plansCreating implementation plans
superpowers:executing-plansExecuting a written plan
superpowers:dispatching-parallel-agents2+ independent tasks
superpowers:subagent-driven-developmentMulti-task execution
superpowers:systematic-debuggingBug investigation
superpowers:test-driven-developmentTDD workflow
superpowers:verification-before-completionQA before marking done
frontend-design:frontend-designUI/UX design work
AgentModelPurpose
ExplorehaikuCheap codebase exploration
PlaninheritRead-only planning
feature-dev:code-architectsonnetArchitecture design
superpowers:code-reviewerinheritCode review
FlagPurpose
-p / --printNon-interactive, exit after response
--permission-mode planRead-only
--permission-mode acceptEditsAuto-approve edits, prompt bash
--dangerously-skip-permissionsFull auto, no prompts
--model sonnet / --model opusModel selection
--max-budget-usd <n>Cost cap
-c / --continueResume last session in this dir
--append-system-promptAdd custom instructions
--agent <name>Use a named agent
--teammate-mode tmuxMulti-agent teams
-w / --worktree [name]Git worktree for isolation
AspectClaude Codesessions_spawn
Interactive controlFull (can iterate)One-shot only
Codebase awarenessAutomaticMust include in prompt
Error recoveryIterates on failuresMust respawn
Multi-file coordinationExcellentHit or miss
CostAnthropic sub (rate-limited)Provider API
ReliabilityHigh (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.

Agent teams (parallel/complex work):

Terminal window
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:

Terminal window
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."