Agent Teams Pattern (Claude Code)¶
The Agent Teams Pattern is an advanced multi-agent workflow in Claude Code where multiple autonomous AI agents collaborate on a shared project^[001-TODO__Claude_Code_5种Agent模式_-从顺序流到自主工作流.md]. Unlike simpler patterns where agents act in isolation or report solely to a central coordinator, Agent Teams enable direct communication and coordination among team members through a shared task board^[001-TODO__Claude_Code_5种Agent模式-_从顺序流到自主工作流.md].
This pattern is designed for complex projects that require cross-functional collaboration (e.g., simultaneous frontend, backend, and testing work) but comes with significantly higher token costs and experimental stability^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
Architecture¶
The Agent Teams pattern utilizes a hub-and-spoke model with peer-to-peer communication capabilities^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
- Shared Task List: The central coordination mechanism is a shared task board. All agents (e.g., Frontend, Backend, Test) can view and interact with this list to manage progress^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
- Teammates: Each teammate is a full Claude Code instance with its own independent context window. This isolates memory and focus, preventing the "context rot" common in long sequential sessions^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
- Team Lead: A designated lead agent oversees the collaboration. Users can choose to interact strictly with the Team Lead or message specific teammates directly to bypass the hierarchy^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
Comparison with Split & Merge¶
While both patterns use multiple agents, they differ fundamentally in communication and control^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]:
| Feature | Split & Merge | Agent Teams |
|---|---|---|
| Communication | Subagents cannot communicate directly; must route through the main Agent^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. | Agents can communicate directly via the shared task list^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. |
| Triggering | Claude automatically decides when to split tasks^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. | Requires explicit instruction in the prompt (e.g., "Form an agent team...")^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. |
| Resource Usage | Moderate token consumption^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. | High consumption, estimated at 4-7x that of a single session^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. |
| Status | Stable^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. | Experimental (Opus 4.6 research preview)^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. |
Configuration & Usage¶
To enable Agent Teams, the feature flag must be activated in the settings file^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]:
{
"claudeCodeExperimentalAgentTeams": true
}
Once active, specialized navigation and interaction controls become available^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]:
- Navigation: Use
Shift+UporShift+Downto switch focus between different teammates in the interface^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流 to自主工作流.md]. - Direct Messaging: The user can send messages directly to any specific teammate, allowing for granular control or intervention without going through the Team Lead^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
When to Use¶
The Agent Teams pattern is best suited for scenarios requiring deep, simultaneous collaboration across different domains^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
- Cross-Role Projects: Complex workflows requiring a Frontend agent, Backend agent, and Test agent to synchronize and debug together^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
- High Complexity: When the task is too complex for a single context window or for the Split & Merge pattern, where agent interdependence is critical^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
Warnings¶
- Token Cost: This pattern consumes tokens rapidly (4-7x normal usage). It is recommended only when simpler patterns (Sequential or Split & Merge) fail^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流 to自主工作流.md].
- Output Verification: High volume of work generated by multiple agents does not guarantee correct work. Human verification remains essential^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流 to自主工作流.md].
Related Concepts¶
- [[Split & Merge Pattern]]
- [[Sequential Flow Pattern]]
- [[Operator Pattern]]
- [[Context Window]]
Sources¶
001-TODO__Claude_Code_5种Agent模式_-_从顺序流 to自主工作流.md