Claude Code agent teams: how they work and when to use them
Agent teams let one Claude Code session act as a lead that spins up several teammates. Each has its own context, and they share a task list and message each other. Used well, they speed up research, review and parallel feature work. Used badly, they burn tokens. Here's how to use them well.
By Laith Al Abbadi, Fractional CTO & AI expert · Updated 15 November 2026
What agent teams are
An agent team has four parts:
- Team lead: your main Claude Code session. It creates the team, assigns work and combines the results.
- Teammates: separate Claude Code instances, each with its own context window. They load your
CLAUDE.md, MCP servers and skills, but not the lead's conversation history. - Shared task list: tasks are pending, in progress or completed, and can depend on other tasks. Teammates claim unblocked tasks, and the lead can also assign them.
- Mailbox: teammates message each other and the lead directly, and you can message any teammate yourself.
How to enable agent teams
Set the environment variable in your shell, or in settings.json:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
Then, in an interactive session, ask for a team in plain language, for example:
Spawn three teammates to review this PR: one focused on security,
one on performance, one on test coverage. Have them share findings
and challenge each other before reporting back.
Teams need an interactive session. Claude doesn't spawn teammates in non-interactive -p mode.
Display modes
- In-process (default): all teammates run in your terminal. Use the agent panel to select a teammate and message it, and Ctrl+T to toggle the task list.
- Split panes: each teammate gets its own pane via tmux or iTerm2. Configure with
teammateModein settings.
Agent teams vs subagents
| Subagents | Agent teams | |
|---|---|---|
| Context | Own window, results returned to the caller | Fully independent sessions |
| Communication | Report back to the main agent | Message each other directly |
| Coordination | Managed by the main agent | Self-coordinate via shared task list |
| Token cost | Lower | Significantly higher (each teammate is a full instance) |
| Best for | Focused jobs where only the result matters | Work that benefits from discussion and parallel ownership |
When agent teams are worth it
- Research and review: several lenses on the same code or question, debated before a conclusion.
- Debugging with competing hypotheses: teammates each try to prove their theory and challenge the others.
- New modules or features where each teammate owns separate files.
- Cross-layer work: front end, back end and tests in parallel.
Avoid teams for sequential tasks, edits to the same files (teammates can overwrite each other), or work with lots of dependencies. A single session or subagents is cheaper and more reliable there.
Best practices from production use
- Start with 3–5 teammates. Token cost grows linearly with team size and returns diminish quickly.
- Give each teammate real context in its spawn prompt: goal, files, constraints and the definition of done.
- Size tasks as self-contained units with a clear deliverable, around 5–6 tasks per teammate.
- Split by file ownership to avoid edit conflicts.
- Pre-approve safe, common operations so permission prompts don't stall the team (teammates inherit the lead's permission mode, so be deliberate).
- Use quality-gate hooks such as
TaskCompletedandTeammateIdleto enforce tests or checks before work is accepted. - Steer, don't abandon. Check in on the lead periodically rather than letting a team run unattended for hours.
Known limitations
- One team per session, and teammates can't spawn their own teammates.
- The lead is fixed for the session's lifetime.
/resumeand/rewinddon't restore in-process teammates.- Task status can lag, and shutdown can be slow.
- Split panes need tmux or iTerm2.
Frequently asked questions
How do I turn on Claude Code agent teams?
Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1 in your environment or in the env block of settings.json, then ask Claude in an interactive session to spawn a team.
What's the difference between agent teams and subagents?
Subagents are workers that do a focused job and report results back to the main agent. Agent teams are independent Claude Code sessions that share a task list and message each other directly. Teams are more powerful and use more tokens.
How many teammates should I use?
The documentation suggests starting with 3–5 teammates for most workflows. Token costs scale with the number of active teammates.
Are agent teams production-ready?
They're experimental. They work well for research, review and parallel feature work, but have known limitations around session resumption, task status and shutdown.