Loading lesson…
Loading lesson…
Agent Teams is a revolutionary feature in Claude Code that allows multiple independent AI instances to collaborate like a real development team.
Imagine that in the past, using Claude Code was like being a project manager working with one exceptionally capable assistant. No matter how complex the task was, only that one assistant was doing the work. Now, with Agent Teams, you can assemble a full AI development team: one member can handle the frontend, one can handle the backend, one can handle testing, and they can work at the same time, communicate with each other, and collaborate to complete complex tasks.
Before diving into Agent Teams, let's first understand the problem it solves.
Limitations of the single-AI mode:
When you use a single Claude instance to handle a complex project, you will run into these bottlenecks:
Serial processing bottleneck: AI can only do one thing at a time. For example, when refactoring a project, it may need to analyze the authentication module first, then the database module, and finally the API module. These steps must be done sequentially, even if they do not depend on each other.
Context crowding problem: All information lives in a single conversation window. As the conversation gets longer, important early details can get buried, and AI may forget key decisions discussed earlier.
Single-perspective limitation: Only one AI is thinking, so there is no multi-angle discussion or validation. When complex design decisions appear, there is no "teammate" to debate with or provide a different perspective.
Efficiency ceiling: Large refactors or multi-module development take a long time, and there is no way to speed them up through parallelism.
The Agent Teams solution:
Agent Teams solves these problems through parallel collaboration across multiple instances:
True parallel work: Multiple AIs can work on different tasks simultaneously. One can handle the frontend UI, another the backend API, and another the database design, without interfering with each other.
Independent context spaces: Every team member has its own full 200K token context window, so important information is not "forgotten" because the conversation gets too long.
Team collaboration capability: Members can communicate directly, discuss design decisions, and validate code quality with each other, just like a real development team.
A significant efficiency increase: According to Anthropic's internal testing, efficiency on large-scale project refactors can improve by around 50%.
Before going deeper into the architecture of Agent Teams, we should first clear up a common point of confusion: what is the difference between Agent Teams and Subagent?
Both features involve "multiple AIs collaborating," but their collaboration models are completely different and suitable for different scenarios.
| Dimension | Subagent | Agent Teams |
|---|---|---|
| Topology | Star topology: all subagents report to the main agent | Mesh topology: members can communicate with each other |
| Communication style | The main agent explicitly passes information via prompts, and subagents return results when done | Members can communicate, discuss, and coordinate directly |
| Context management | Every subagent has an independent context, and the main agent passes only the necessary information | Every member has a fully independent context |
| Parallelism | Can run in parallel, but the collaboration chain still centers on the main agent | True parallel development and collaboration |
| Task coordination | The main agent dispatches and coordinates everything centrally | Members can take ownership of tasks more autonomously |
| Cost | Not low. Token usage stacks when multiple subagents run in parallel | Higher. Members run independently and communicate more frequently |
Subagent is like: a manager writing separate task slips for several assistants. Each assistant works independently based on its own task slip, and when finished, only returns the result to the manager. The assistants do not communicate directly, and the manager does not see the assistants' full thought process while they work.
You → Main Agent → Subagent A: "Analyze this file"
You → Main Agent → Subagent B: "Search for that function"
↓
Subagent A completes → reports result to Main Agent
Subagent B completes → reports result to Main Agent
↓
Main Agent synthesizes the results → reports back to you
Agent Teams is like: a project manager leading a real development team. Team members can communicate, discuss, and collaborate directly, rather than routing every detail through the project manager.
You → Team Lead: "Build a user authentication feature"
↓
Team Lead creates the team and assigns tasks
↓
Teammate A: "@Teammate B, is the API interface design ready?"
Teammate B: "Yes, here's the format..."
Teammate C: "I reviewed the interface and found something we should discuss..."
↓
Team members collaborate to finish the work → Team Lead synthesizes the result → reports back to you
Use Subagent when:
Use Agent Teams when:
Agent Teams is not just a simple "open multiple instances" feature. It is a complete multi-agent collaboration system. To understand it, we need to understand its core components and how they work together.
An Agent Team consists of four core components, each with its own responsibility, working together to complete complex tasks.
Team Lead
The Team Lead is the "brain" and "coordinator" of the entire team. It does not directly execute coding tasks. Instead, it is responsible for:
Teammates
Teammates are the actual "developers" doing the work. Every Teammate is an independent Claude instance:
TaskList
TaskList is the team's "project management tool," similar to Jira or Trello:
pending, in_progress, or completedMessaging System
The messaging system is the "chat tool" between team members:
~/.claude/teams/{team-name}/inboxes/A typical Agent Teams workflow looks like this:
The user submits a complex requirement
↓
Team Lead analyzes the requirement and breaks it into tasks
↓
Creates team members and initializes TaskList
↓
├─→ Teammate A claims Task 1 ─┐
├─→ Teammate B claims Task 2 ─┼→ Run in parallel
├─→ Teammate C claims Task 3 ─┤
│ ↓
└──────────────────────────── Members coordinate through the messaging system
↓
Once all tasks are complete, Team Lead synthesizes the result
↓
Final output is delivered to the user
Agent Teams creates dedicated directories on your local file system to manage team state:
~/.claude/
├── teams/
│ └── {team-name}/
│ ├── config.json # Team config (member list, model selection, etc.)
│ └── inboxes/
│ ├── team-lead.json # Team Lead inbox
│ ├── teammate-1.json # Member 1 inbox
│ └── teammate-2.json # Member 2 inbox
└── tasks/
└── {team-name}/
├── task-1.json # Detailed info for Task 1
├── task-2.json # Detailed info for Task 2
└── current_tasks/
└── parse_if_statement.txt # Lock file created while a task is running
The advantage of this design is complete transparency: you can inspect team status, task progress, and the communication history between members at any time.
Agent Teams is currently an experimental feature and is disabled by default. To use it, you need to enable it first.
The easiest way: let Claude Code enable it for you
Type this directly in Claude Code:
Help me enable Agent Teams in settings.json
Or:
Enable the experimental feature agentTeams
Claude Code will automatically modify ~/.claude/settings.json and add the following configuration:
{
"experimental": {
"agentTeams": true
}
}
Restart Claude Code
After the configuration is added, fully quit and restart Claude Code, and the feature will take effect.
Manual configuration (if the automatic method does not work):
You can manually edit ~/.claude/settings.json and add or modify:
{
"experimental": {
"agentTeams": true
}
}
How to verify it is enabled
After restarting Claude Code, try a conversation like this:
You: Can you help me create an Agent Team?
Claude: Yes! I can help you create an Agent Team to collaborate on a task...
If Claude understands and responds to the request to create a team, the feature has been enabled successfully.
If you want to see team members' work in real time, you can configure split-pane display mode.
Let Claude Code configure it for you:
Type this directly in Claude Code:
Help me enable split-pane display mode for Agent Teams in settings.json, using tmux
Or:
Configure agent-teams to use split-panes mode
Install tmux (if you do not have it):
If tmux is not installed yet, you can ask Claude Code to install it:
Help me install tmux
Claude Code will automatically run the appropriate installation command based on your operating system, whether macOS or Linux.
What the configured result looks like:
After configuration, team members will work in different tmux panes, and you will be able to see all their output at the same time, like a "monitoring wall."
┌─────────────────┬─────────────────┬─────────────────┐
│ Teammate 1 │ Teammate 2 │ Teammate 3 │
│ Analyzing code │ Building API │ Writing tests │
│ ... │ ... │ ... │
│ │ │ │
└─────────────────┴─────────────────┴─────────────────┘
Manual configuration (if the automatic method does not work):
You can manually edit ~/.claude/settings.json:
{
"experimental": {
"agentTeams": true
},
"agent-teams": {
"displayMode": "split-panes",
"terminalMultiplexer": "tmux"
}
}