Blog
Claude Code agent teams: how to turn them on, how they actually coordinate, and when a single session is the smarter call
Agent teams let one Claude Code session lead several others that claim tasks and talk to each other. They are powerful and expensive. Here is the setup, the mechanics, and an honest guide to when they are worth it.
The first time you watch three Claude Code sessions split a problem, argue about it, and hand you one answer, it feels like the future arrived early. The second time, you look at your usage meter. Agent teams are genuinely useful, but only for a specific shape of work, and Anthropic's own docs are refreshingly honest about that.
The short answer: agent teams let one Claude Code session act as a lead that spawns teammates. Each teammate is a full, independent Claude Code instance with its own context window. They coordinate through a shared task list and direct messages, and you can talk to any of them yourself. The feature is experimental and off by default (Claude Code docs).
Turn them on
Set one environment variable, in your shell or in settings.json:
{
"env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" }
}
Then describe the team you want in plain language. Anthropic's own example:
I'm designing a CLI tool that helps developers track TODO comments across
their codebase. Spawn three teammates to explore this from different angles:
one on UX, one on technical architecture, one playing devil's advocate.
Two gotchas from the docs. First, teams only form in interactive sessions; with -p or the Agent SDK, named agents run as ordinary subagents. Second, once teams are enabled, any subagent Claude names launches as a teammate, so teams can form when you didn't ask for one. If that surprises your token budget, turn the flag back off.
Subagents vs agent teams
| Subagents | Agent teams | |
|---|---|---|
| Context | Own window; result returns to caller | Own window; fully independent |
| Communication | Report back to the main agent | Teammates message each other directly |
| Coordination | Main agent manages everything | Shared task list plus messages |
| Best for | Focused tasks where only the result matters | Work that needs discussion and challenge |
| Token cost | Lower | Higher: each teammate is a separate instance |
Source: Claude Code docs. If you're new to the distinction, our explainer on multi-agent orchestration and the glossary entries for orchestrator and agent handoff cover the general patterns.
How the coordination actually works
- Tasks have three states: pending, in progress, completed. Tasks can depend on others and show as blocked until those finish.
- Assignment is two-way: the lead can assign a task to a named teammate, or teammates self-claim the next unassigned, unblocked task when they finish one. Claiming uses file locking so two teammates can't grab the same task.
- You can step in: in the default in-process mode, use the arrow keys in the agent panel to select a teammate, press Enter to read its transcript and message it,
xto stop it, and Ctrl+T to toggle the task list. - Split panes give each teammate its own pane, but need tmux or iTerm2. Set
"teammateMode": "auto"in~/.claude/settings.json. - Plan first for risky work. Put the lead in plan mode before spawning an "architect" teammate and it plans before implementing. Note the subtlety in the docs: unless you changed the teammate's permission mode, Claude Code approves that plan automatically when it arrives, without the lead reviewing it.
Choosing models per teammate
This is where you control cost. Claude Code picks each teammate's model from the first rule that applies:
- The model named in your spawn prompt ("Use Sonnet for each teammate").
- A subagent definition's
model(whereinheritmeans the lead's model). CLAUDE_CODE_SUBAGENT_MODEL, if set to something other thaninherit.- The lead's model.
CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 (v2.1.257+) makes the environment variable win over the first two. A practical pattern: keep the lead on your strongest model for judgment and synthesis, and run implementation teammates on a cheaper one.
Quality gates with hooks
Three hooks turn a team from "hopeful" into "reviewable." Each can exit with code 2 to push back with feedback:
TeammateIdle: runs when a teammate is about to go idle. Use it to insist tests pass before anyone stops.TaskCreated: veto tasks that are too vague or too big.TaskCompleted: block a task from being marked done until a check passes, such as lint or a test suite.
If you only adopt one, make it TaskCompleted. The most common failure in multi-agent coding is a confident "done" on work that doesn't build.
When a team is worth it
Anthropic lists four strong use cases, and they match what we see in practice:
- Research and review, where teammates investigate different angles and challenge each other.
- New modules or features with clean ownership boundaries.
- Debugging with competing hypotheses, tested in parallel.
- Cross-layer changes where frontend, backend and tests each get an owner.
And when it isn't: sequential tasks, edits to the same file, or work with many dependencies. In those cases one session, or one session with subagents, is faster and much cheaper. The research backs this up; see our notes on parallel agent teams and test-time compute for when extra agents buy accuracy and when they just buy tokens.
Known limits (as documented)
- One team per session; no nested teams; teammates can't spawn teammates.
- The lead is fixed for the session's lifetime.
- Task status can lag, leaving dependent tasks blocked. Check and nudge.
- Shutdown can be slow because teammates finish their current call first.
- No per-teammate permission modes at spawn.
- In-process teammates can't run background subagents.
How this compares with Antigravity's swarm
Google's Antigravity has a similar /swarm command with a coordinator, named workers, a @verifier per two to four workers, and a shared message board where idle members sleep without using tokens. We compare the two tools head to head in Antigravity vs Claude Code.
The honest bottom line: agent teams are a power tool. Reach for them when the work splits cleanly and the disagreement between agents is the point. For everything else, one focused session with good instructions, like a tight AGENTS.md, still wins on cost and often on quality.
FAQ
How do I enable agent teams in Claude Code?
Agent teams are experimental and off by default. Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1 in your shell or in the env block of settings.json, start an interactive session, and ask Claude to spawn teammates for the task. Teams do not form in non-interactive -p mode or Agent SDK sessions.
What is the difference between Claude Code subagents and agent teams?
Subagents run inside one session and return a summarized result to the main agent, which manages all the work. Agent team teammates are fully independent Claude Code instances that share a task list, claim work and message each other directly. Teams cost more tokens because every teammate is a separate session.
Can I choose a different model for each teammate?
Yes. Name the model in your spawn prompt, for example 'Spawn 4 teammates and use Sonnet for each.' Claude Code otherwise falls back to a subagent definition's model, then CLAUDE_CODE_SUBAGENT_MODEL, then the lead's model, and it checks every choice against any availableModels allowlist.
Do Claude Code agent teams cost more?
Yes. Anthropic's docs say agent teams add coordination overhead and use significantly more tokens than a single session, because each teammate is its own Claude instance with its own context window. Use them for work that genuinely parallelizes.
What are the known limitations of agent teams?
Per Anthropic's docs: one team per session, no nested teams, the lead is fixed for the session, task status can lag and block dependent tasks, shutdown can be slow, there are no per-teammate permission modes at spawn, and split panes need tmux or iTerm2.