An agent team lets multiple Claude Code instances work together on one larger problem. The lead session coordinates the work, while teammates independently investigate or implement assigned tasks. Unlike ordinary subagents, teammates can communicate directly with one another.
The official Claude Code documentation currently describes agent teams as experimental and disabled by default. They must be explicitly enabled before Claude can create a team.
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
You can enable the feature in your shell environment or in settings.json.
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
| Subagents | Agent Teams |
|---|---|
| Workers operate inside one main session. | Each teammate is a separate Claude Code session. |
| Results return to the main agent. | Teammates communicate directly with each other. |
| Main agent manages the work. | Team members can coordinate through messages and a shared task list. |
| Lower token cost. | Higher token cost. |
| Best for focused side tasks. | Best for complex work requiring discussion and collaboration. |
The strongest use cases are:
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
With agent teams enabled, named agents created during interactive sessions can launch as teammates.
In non-interactive -p mode, Claude does not spawn teammates; named delegation remains ordinary subagent work.
After enabling teams, describe the task and the teammates you want in natural language.
I'm designing a CLI tool that helps developers track TODO comments
across their codebase.
Spawn three teammates:
- one focused on UX
- one focused on technical architecture
- one playing devil's advocate
Have them explore the problem independently and then synthesize
the findings.
Claude can create the teammates, populate a shared task list when Task tools are available, and synthesize the results. Sometimes Claude may choose ordinary subagents instead; if you specifically need a team, explicitly ask for an agent team.
| Component | Role |
|---|---|
| Team lead | The main Claude Code session that spawns teammates and coordinates work. |
| Teammates | Separate Claude Code sessions working on assigned tasks. |
| Task list | Shared list of work items that teammates claim and complete. |
| Mailbox | Messaging mechanism used for communication between agents. |
The shared task list coordinates work across the team. Tasks can be pending, in progress, or completed. Tasks can also have dependencies.
Task A: Research API
Task B: Research database
Task C: Design architecture
Task D: Implement feature
↑
depends on A + B + C
A task with unresolved dependencies cannot be claimed until those dependencies are completed. Agents with Task tools can also self-claim the next unassigned, unblocked task.
| Method | How it works |
|---|---|
| Lead assigns | The lead tells a particular teammate which task to perform. |
| Self-claim | After finishing, a teammate picks up an available unassigned task. |
Task claiming uses file locking to avoid race conditions when multiple teammates try to claim the same task.
Agent teams currently support two main display modes.
All teammates run inside the main terminal. Use the agent panel to select a teammate and press Enter to view and message it. This works in any terminal and is the current default.
Each teammate gets its own terminal pane, so you can see multiple outputs simultaneously and interact directly with each pane. Split panes require tmux or iTerm2.
| Mode | Requirement | Best for |
|---|---|---|
| In-process | No extra setup | General use and portability |
| Split panes | tmux or iTerm2 | Watching several teammates visually at once |
{
"teammateMode": "auto"
}
Or for one session:
claude --teammate-mode auto
Other documented values include in-process, tmux, and iterm2.
The --teammate-mode flag is experimental.
For native iTerm2 split panes, the documentation requires the it2 CLI and the iTerm2 Python API.
Enable the Python API in:
iTerm2 → Settings → General → Magic → Enable Python API
Split-pane mode can use tmux. Install tmux through your operating system's package manager. The documentation notes that tmux has platform-specific limitations and traditionally works best on macOS.
Claude can choose the number of teammates based on the task, or you can specify exactly what you want.
Spawn 4 teammates to refactor these modules in parallel.
Use Sonnet for each teammate.
Claude Code selects a teammate's model using this order:
CLAUDE_CODE_SUBAGENT_MODEL, when configured.Organization model allowlists can affect the final selection. Teammates also inherit the lead's effort level.
A teammate can use a reusable subagent definition from project, user, plugin, or CLI scope. This lets you define roles such as security-reviewer or test-runner once.
Spawn a teammate using the security-reviewer agent type
to audit the authentication module.
The teammate can inherit configuration such as its tool list, model, and system-prompt body.
The exact behavior of fields such as skills and mcpServers depends on the display mode.
A teammate automatically loads normal project context such as CLAUDE.md, MCP servers, and Skills.
However, it does not inherit the lead's conversation history.
Review src/auth/ for security vulnerabilities.
Focus on token handling, session management, and input validation.
The app uses JWT tokens stored in httpOnly cookies.
Report findings with severity ratings.
Each teammate is a full independent Claude Code session. You can message a teammate directly to give instructions, ask follow-up questions, or redirect its approach. Teammates can also message one another.
A message from another agent is treated as coming from another Claude session, not from you. A teammate cannot approve a permission request on your behalf or use another teammate's message to bypass a denied action.
In Auto mode, Claude Code also checks inter-agent messages before delivering them. Messages that attempt to relay approval or other untrusted claims can be blocked.
Teammates start with the lead's permission mode.
If the lead uses --dangerously-skip-permissions, teammates inherit that mode too.
--dangerously-skip-permissions casually.
All teammates inherit the lead's starting permission mode.
After spawning, individual teammate permission modes can be changed, but per-teammate modes cannot be specified at spawn time. Permission prompts from teammates appear in the lead session.
For complex or risky tasks, start the lead in Plan Mode before spawning teammates. A teammate spawned while the lead is in Plan Mode works in read-only planning mode until its plan is ready.
Spawn an architect teammate to refactor the authentication module.
The teammate sends a plan approval request to the lead. Claude Code approves that plan in the lead session automatically; the teammate's later edits and commands still go through the normal permission system.
Click into a teammate's pane to interact directly with its terminal.
The agent panel shows teammates as they work, fail, or become idle. Current versions keep an idle teammate visible while another teammate is still working; once the whole panel becomes idle, idle rows can hide after a short delay.
When many teammates are idle, their rows can collapse into a single count such as 2 idle agents.
Ask the lead to shut down a teammate by name:
Ask the researcher teammate to shut down
The lead sends a shutdown request. The teammate can approve the request and exit gracefully or reject it with an explanation. Team shared directories are cleaned up automatically when the session ends.
Hooks can enforce rules at important team events.
| Hook | Purpose |
|---|---|
TeammateIdle | Runs when a teammate is about to go idle. Exit code 2 can send feedback and keep it working. |
TaskCreated | Can validate or reject a newly created task. |
TaskCompleted | Can validate or prevent a task from being marked complete. |
TaskCompleted hook could require tests to pass before a teammate is allowed
to mark an implementation task complete.
Each teammate has its own context window.
Lead context
│
├── Spawn prompt
│
├── Teammate A context
│ └── messages
│
├── Teammate B context
│ └── messages
│
└── Teammate C context
└── messages
The lead's conversation history does not automatically transfer to teammates. Instead, teammates receive project context and the spawn prompt, then communicate findings through messages and task state.
Agent teams use significantly more tokens than a single session because each teammate is its own Claude instance with its own context. Token usage grows with the number of active teammates.
| Situation | Recommendation |
|---|---|
| Routine task | Prefer one session. |
| Focused side task | Prefer a subagent. |
| Complex independent work | Consider an agent team. |
| Parallel research/review | Agent teams can justify the extra tokens. |
There is no hard fixed limit, but practical limits appear quickly. More teammates mean more communication, coordination, possible conflicts, and diminishing returns.
| Too small | Just right | Too large |
|---|---|---|
| Coordination costs more than the work. | Self-contained deliverable such as a function, test file, or review. | Teammate works too long without feedback. |
The documentation suggests roughly 5–6 tasks per teammate as a useful level when a larger task is being divided.
Two teammates editing the same file can overwrite one another. Divide ownership so each teammate controls a different set of files.
Teammate A → src/frontend/
Teammate B → src/backend/
Teammate C → tests/
Sometimes the lead starts implementing the solution itself before teammates have finished their work. If you want the lead to wait, tell it explicitly:
Wait for your teammates to complete their tasks before proceeding.
If you are new to agent teams, begin with tasks that have clear boundaries and do not require parallel implementation:
These tasks demonstrate the value of parallel exploration without introducing as many file-edit conflicts.
Spawn three teammates to review PR #142:
- One focused on security implications
- One checking performance impact
- One validating test coverage
Have them each review and report findings.
Each teammate uses a different review lens. The lead then synthesizes the findings.
Users report the app exits after one message instead of staying connected.
Spawn 5 agent teammates to investigate different hypotheses.
Have them challenge each other's theories like a scientific debate.
Update the findings document with the consensus.
The goal is to reduce anchoring: instead of accepting the first plausible explanation, independent teammates actively try to disprove competing theories.
Build the new notification feature.
Teammate A → frontend UI
Teammate B → backend API
Teammate C → tests
Teammate D → documentation
Coordinate dependencies and synthesize the final result.
This works best when each teammate owns a distinct area and dependencies are clearly represented.
tmux is installed and on PATH.it2 CLI and Python API setup.When agent teams are enabled, Claude may turn named subagents into teammates. If you want ordinary subagents instead, disable agent teams:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "0"
}
}
Settings precedence still matters: higher-precedence project/local settings or managed settings can override user settings.
Teammate permission requests appear in the lead session. If many teammates repeatedly perform the same safe operation, pre-approve appropriate common operations in your permission settings.
A teammate may stop after an error instead of recovering. Select it and inspect its output, then either:
The lead itself can also decide the team is finished too early. Tell the lead to continue if tasks remain.
If a tmux session remains after Claude Code exits, list tmux sessions:
tmux ls
Then terminate the team-created session:
tmux kill-session -t <session-name>
/resume or /rewind.| Approach | Use it when... |
|---|---|
| Single session | The task is sequential or tightly coupled. |
| Subagent | You need focused side work and only its result matters. |
| Agent view | You want to monitor independent sessions you run yourself. |
| Agent team | Multiple Claude sessions need direct collaboration. |
| Worktrees | You need manual parallel sessions with isolated Git checkouts. |
/resume exactly as it was.teammateMode control?CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1. TEAM LEAD
│
┌───────────┼───────────┐
↓ ↓ ↓
Teammate A Teammate B Teammate C
Research Implement Review
│ │ │
└────── Messages / Tasks ──────┘
↓
Lead synthesizes
↓
Final result