Skip to content

Claude Code SOP

Claude Code SOP — Agent Orchestration Guide

Section titled “Claude Code SOP — Agent Orchestration Guide”

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
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."
  1. Project must be a git repogit init if needed. Claude Code requires it.
  2. Always include “Do NOT ask questions”
  3. Always include build/verify step
  4. Always include commit step
  5. Batch large tasks
  6. Set --max-budget-usd
  7. Set timeout to 600s
  8. Monitor progress
  9. Update the user every 10 min
FlagPurpose
-p / --printNon-interactive, exit after response
--dangerously-skip-permissionsFull auto, no prompts
--model sonnet / --model opusModel selection
--max-budget-usd <n>Cost cap