Claude Code Agent Teams: Setup, Cost, and Limits
Claude Code agent teams: how to enable them, what a team really costs in tokens, and when a subagent beats a team of separate sessions.

One Claude Code session, six unfinished tasks, and a Thursday deadline. Someone on X says you need a swarm of agents. The setup takes four lines. The part nobody posts is the bill.
Claude Code agent teams run several Claude Code sessions on one job. A lead session splits the work, and teammates with their own context windows claim tasks and message each other directly. The feature is experimental, off by default, and each teammate bills as a separate Claude instance.
TL;DR
- Agent teams are one lead session plus teammates that message each other. Subagents report back to a single caller instead.
- Anthropic’s agent team token costs page puts a planning team at about 7x the tokens of a standard session.
- Turn the feature on with one env var, then plan for file overwrites, lagging task status, and a 5-minute cache.
What are Claude Code agent teams?
An agent team is one lead session plus teammates, each running in its own context window. The lead builds a shared task list. Teammates claim tasks and message each other by name. Then they report back. One session holds one team, and the lead stays the lead.
The parts sit on disk where you can read them mid-run:
- The lead session plans the job and owns the final answer.
- Teammates are full Claude Code sessions, not helper calls inside yours.
- The shared task list moves each item from pending to in progress to done.
- The mailbox carries direct messages between agents, any to any.
Each agent’s mailbox is a JSON file at ~/.claude/teams/<team-name>/inboxes/<agent-name>.json, and Claude Code validates entries as it reads them. The task list lives at ~/.claude/tasks/<team-name>/ and survives the session, with cleanupPeriodDays setting retention, where teams are stored.
Community write-ups call these swarms. Anthropic lists swarm in the page keywords next to teammate and multi-agent, then uses “team” in the body. Same object, two names.
A teammate starts with none of the lead’s conversation. At spawn it loads CLAUDE.md, MCP servers and skills, what a teammate loads at spawn. That is why which skills you keep installed matters here, and Claude Code agent skills covers the inventory side.
Cold starts are the real cost centre: a vague spawn prompt makes a teammate rediscover context you already paid for once.
How do I turn agent teams on in Claude Code?
Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in your shell or in the env block of settings.json. The feature is experimental and disabled by default. Then ask for teammates by role. Display stays in-process until you change teammateMode, and in-process works in any terminal.

The mode table from this section, side by side.
The env var is the only switch. Inside settings.json it reads "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1", and the docs warn the feature has known limits around resumption and shutdown.
Enabling teams also changes plain delegation. When Claude names a subagent on its own, that subagent launches as a teammate. Claude Code does not ask you first, a named subagent launches as a teammate. Set the variable to 0 to get ordinary subagents back.
teammateMode |
What you see | What it needs |
|---|---|---|
| in-process | agent panel under the prompt | nothing extra |
tmux |
split panes in a tmux session | tmux installed |
iterm2 |
native iTerm2 panes | iTerm2 plus the it2 CLI |
auto |
the docs’ suggested starting mode | tmux or iTerm2 |
The --teammate-mode flag sets the mode for one session. The docs label that flag experimental and note it does not appear in claude --help.
Scripted runs get no teammates: with -p, including Agent SDK sessions, Claude Code never spawns one, however the flag is set.
Agent teams or subagents: which one fits the job?
Subagents suit focused tasks where only the result matters. A team suits work that needs discussion between workers. Subagents cost less because their output returns to one caller as a summary rather than a live session.
| Question | Subagents | Agent teams |
|---|---|---|
| Context | own window, results return to caller | own window, fully independent |
| Talk to each other | no, each reports back | yes, by name, any to any |
| Who coordinates | the main agent | teammates claim from a shared task list |
| Best for | focused tasks where only the result matters | complex work needing discussion |
| Token cost | lower, results get summarized | higher, each is a separate instance |
That table mirrors Anthropic’s own side-by-side comparison. The difference that bites in practice is who keeps the plan. A subagent forgets its reasoning when it returns. A teammate keeps its session open and can be redirected mid-run.
A subagent definition can set isolation: worktree so its shell commands run inside a copy of the repo, subagent frontmatter fields. A teammate is a separate session, so its file discipline is yours to enforce.
If you only need sessions to pass findings, cross-session messaging does that without a team, and the docs point there before teams. I compared the shapes for content work in skills, MCP, and subagents.
Start with subagents: they keep the context isolation and drop most of the coordination cost.
The 3-check gate I run before spawning anything
Almost no job in my business passes this gate, and that is the point. I ask three questions before a task earns a team.
- Do the pieces run without waiting on each other?
- Does each piece need to argue with the others, or only report?
- Will this job come back next month, so the setup pays out?
Question one kills most candidates. My outreach system handles around 200 form submissions a day, and every step reads the step before it. Splitting that across teammates buys a token bill and nothing else.
Question two picks the shape. Workers that only report are subagents. Workers that must challenge each other are a team. Question three decides whether the setup worth anything can be reused. Anthropic’s own agent guide says to find the simplest solution first and add complexity only when needed, building effective agents.
Question two is the fork in the road: talk-only workers are subagents, debaters are teammates.
What does a team actually cost in tokens?
Roughly 7x the tokens of a standard session when teammates run in plan mode, per Anthropic’s agent team token costs. Each teammate keeps its own context window and bills as a separate instance, so the bill scales with the number of active teammates.
Anthropic is blunter on its engineering side. Agents use about 4x the tokens of chat, and multi-agent systems use about 15x, Anthropic multi-agent research system.
What those tokens bought in their eval was breadth. An Opus 4 lead with Sonnet 4 subagents beat a single Opus 4 by 90.2 percent on their internal research test. Token use alone explained 80 percent of the performance variance in their BrowseComp analysis.
You control the biggest lever at spawn. Claude picks a teammate’s model from the first of these that applies:
- The model your spawn prompt names for that teammate.
- The subagent definition’s
modelvalue, whereinheritmeans the lead’s model. CLAUDE_CODE_SUBAGENT_MODEL, when it is set to anything other thaninherit.- The lead’s current model.
CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 throws out the first two. The docs also note that in-process teammates sit outside your main cache window. Their cache holds for 5 minutes by default. subagentPromptCacheTtl can raise it to an hour, prompt cache for teammates. One-hour cache writes bill at a higher rate.
A mixed team is the cheap one: put the expensive model on the lead and a cheaper one on teammates that read and report.
What breaks when the team runs unattended?
In-process teammates disappear on /resume, and task status lags behind real work. Shutdown waits on the current tool call, and a session holds one team with no nesting. A teammate also cannot run background subagents.
The documented limits worth planning around:
/resumeand/rewindrestore the lead but not in-process teammates.- A teammate can finish a task and leave the row unmarked, which blocks whatever depended on it.
- Shutdown finishes the current tool call first, so a long write delays the exit.
- One team per session, and teammates cannot spawn their own teammates.
- Teammates start at the lead’s permission mode, with no per-teammate mode at spawn.
- Split panes need tmux or iTerm2, though in-process mode runs anywhere.
Hooks cover the failure the docs cannot. TeammateIdle fires as a teammate goes idle, TaskCreated fires when a task is created, and TaskCompleted fires when one is marked done. Exit code 2 blocks the change and sends feedback to the agent, enforce quality gates with hooks.
Exit code 2 turns a hook into a wall: the task stays open and the teammate gets your feedback instead of a pass.
Why one owner per file beats a bigger team
Every overwrite I have eaten came from two writers on one file, and a bigger team makes that worse. The docs are specific about what the lock protects. Task claiming uses file locking so two teammates cannot claim the same item, and the same page still tells you to avoid file conflicts, shared task list.
Some guides credit that lock with preventing two agents from editing the same file. The lock covers claims, not edits.
My rule now is one owner per artifact. In the pipeline that produces these posts:
- The draft stage writes the draft file.
- The reviewer reads it and writes verdicts only.
- The publisher writes the site file.
No stage writes another stage’s file.
The rule came out of a real failure. A failed draft pass truncated the draft file to 0 bytes, and the next stage rewrote from an empty outline instead of the reviewed draft. Each stage now asserts its input exists and is not empty before it writes anything.
Ownership beats coordination: a rule naming who writes a file removes a class of conflict that messaging cannot fix.
What work should I hand to a team first?
Start with review or research. A parallel code review is the docs’ first worked example, because each reviewer runs on its own lens. Teammates testing competing hypotheses also fit, since they can argue without blocking each other.
The shapes that work:
- Review and research, where each teammate takes a different angle.
- New modules, where each teammate owns a separate piece.
- Debugging with competing hypotheses, run in parallel and then merged.
- Cross-layer work, where one teammate owns each layer.
The lane I keep on one session is the fix pass. When a review rejects a draft, the rewrite starts from the exact file the reviewer read. A team would add handoffs between two stages that must share one artifact.
Hand a team work that splits by owner and ships on its own, and keep serial rewrites on a single session.
Is a team worth it for one small business job?
Usually not. A recurring job with dependent steps gets cheaper on one session, and the extra tokens buy parallel exploration a small job does not need. A team earns its bill when the work is research-shaped or repeats often enough to reuse the setup.
Anthropic puts the economics plainly. Multi-agent systems need tasks whose value covers the extra tokens, and most coding tasks have fewer parallel parts than research does, where multi-agent systems fit.
My own agency work runs the same steps per site in a fixed order. A team would multiply the tokens without multiplying the output, so it stays on one session and the savings go to the next site.

The services page, for the build-it-for-me route.
If you would rather have someone find the job that is worth a team and build it, that is the work on our AI services page. The prompt bundle at automatereal.com/skills covers the writing and review side for $99, which is a cheap way to test whether a job is team-shaped.

The skills bundle, if you want to test the shape yourself.
This feature is months old. My own team runs are weeks old, and I say so plainly.
Test the work on one session plus a subagent first: if that ships it, a team is an upgrade you cannot justify yet.
For a managed version, see the skills bundle.
FAQ
Does /resume bring my teammates back after I close the session?
No. /resume and /rewind restore the lead’s conversation only, so in-process teammates do not come back. The lead may try to message teammates that no longer exist. Tell it to spawn new ones.
Can a teammate spawn its own teammates?
No. Teams do not nest, and only the lead manages the team. A teammate can start its own subagents, but those run in the foreground, so that work cannot outlive the lead’s process.
Can I run agent teams in the VS Code terminal or only in a real terminal?
In-process mode runs in any terminal, and the docs make no exception for the VS Code one. Split panes are the part with requirements, since they need tmux or iTerm2.
Can I pick a different model for each teammate?
Yes. Name the model in the spawn prompt, or set it in the subagent definition. CLAUDE_CODE_SUBAGENT_MODEL applies to teammates you did not specify, and CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 overrides your own picks.
Do agent teams work in CI or a scripted pipeline?
No. With -p, including Agent SDK sessions, Claude Code spawns no teammates. The team features need an interactive session, so CI keeps its single-session behaviour whatever the env var says.
Is a Claude Code agent team the same thing as multi-agent work on the Agent SDK?
No. Teams are an interactive Claude Code feature with a lead, a task list and a mailbox. The Agent SDK gives you an orchestration loop you build and pay for yourself.
If you want help picking that first workflow, a discovery call sorts it in about half an hour.