8.1 Three Multi-Agent Patterns
Claude Code supports three multi-Agent collaboration patterns, suitable for scenarios of varying complexity:
mermaid
graph LR
subgraph Pattern1 ["Sub-Agent (AgentTool)"]
P1[Parent Agent] -->|fork| C1[Sub-Agent]
C1 -->|return result| P1
end
subgraph Pattern2 ["Coordinator"]
CO[Coordinator<br/>only assigns, never executes] -->|spawn| W1[Worker 1]
CO -->|spawn| W2[Worker 2]
CO -->|spawn| W3[Worker 3]
W1 -->|result| CO
W2 -->|result| CO
W3 -->|result| CO
end
subgraph Pattern3 ["Swarm Team"]
T1[Agent A] <-->|mailbox communication| T2[Agent B]
T2 <-->|mailbox communication| T3[Agent C]
T1 <-->|mailbox communication| T3
end| Pattern | Use Case | Communication | Characteristics |
|---|---|---|---|
| Sub-Agent | Single independent subtask | fork-return | Simplest, parent Agent waits for result |
| Coordinator | Complex multi-step task | spawn + synthesize | Coordinator does not execute, only orchestrates |
| Swarm Team | Parallel collaborative task | Named mailbox | Peer-to-peer communication between Agents |