Multi-Agent Architecture
Coordinator mode, agent swarms, and sub-agent spawning.
Overview
Claude Code supports multi-agent workflows at three levels:
- Sub-Agents — The AI spawns workers to handle tasks in parallel
- Coordinator Mode — The AI acts as an orchestrator managing multiple workers
- Agent Swarms — Teams of agents working together
Sub-Agents (AgentTool)
How It Works
User: "Refactor the auth module and update the tests"
│
▼
AI decides to parallelize
│
├─ AgentTool("Refactor auth module in src/auth/")
│ └─ Spawns sub-agent 1
│
└─ AgentTool("Update tests in tests/auth/")
└─ Spawns sub-agent 2
│
▼
AI continues with other work
│
▼
Sub-agents work independently
│
▼
Results delivered as <task-notification> blocks