Six Orchestration Patterns

Description

Claude Code's source implements several of the six community-cataloged orchestration patterns -- Orchestrator, Fan-Out/Fan-In, Validation Chain, Specialist Routing, Progressive Refinement, and Watchdog -- though the codebase does not name them using this taxonomy. The patterns emerge from the coordinator system prompt in coordinatorMode.ts, the built-in agent definitions under tools/AgentTool/built-in/, the team-creation workflow in TeamCreateTool/prompt.ts, and the fork-subagent system in forkSubagent.ts.

The Orchestrator pattern is the most explicit: the coordinator system prompt in coordinatorMode.ts states "You are a coordinator. Your job is to: Help the user achieve their goal, Direct workers to research, implement and verify code changes, Synthesize results and communicate with the user." The coordinator never writes code itself -- it spawns workers via the Agent tool, receives results via <task-notification> XML messages, synthesizes findings, and directs follow-up work. Fan-Out/Fan-In is codified in the coordinator's concurrency guidance: "Parallelism is your superpower. Workers are async. Launch independent workers concurrently whenever possible" and "To launch workers in parallel, make multiple tool calls in a single message." The fork system (forkSubagent.ts) also supports this: "If research can be broken into independent questions, launch parallel forks in one message." Specialist Routing appears through built-in agent types with distinct capabilities: Explore (read-only search specialist, uses Haiku model for speed), Plan (architecture specialist, read-only), and verification (adversarial testing specialist with explicit anti-modification rules). The TeamCreateTool prompt further distinguishes "Read-only agents" from "Full-capability agents" and "Custom agents." Validation Chain is the builder-validator separation enforced structurally: the verification agent in verificationAgent.ts has disallowedTools set to [AGENT_TOOL_NAME, FILE_EDIT_TOOL_NAME, FILE_WRITE_TOOL_NAME, NOTEBOOK_EDIT_TOOL_NAME], preventing it from modifying project files. Its system prompt states "You are STRICTLY PROHIBITED from: Creating, modifying, or deleting any files IN THE PROJECT DIRECTORY." The coordinator workflow tables show verification as a distinct phase: "Research -> Synthesis -> Implementation -> Verification."

Key claims

Relations

Sources

src-20260410-orch-patterns-a: src/coordinator/coordinatorMode.ts, src/tools/AgentTool/built-in/verificationAgent.ts, src/tools/AgentTool/built-in/exploreAgent.ts, src/tools/AgentTool/built-in/planAgent.ts, src/tools/AgentTool/forkSubagent.ts, src/tools/TeamCreateTool/prompt.ts