Claude Code Agent Teams: How to Set Up and Run a Team of Claude Sessions
By Shubhranshu, creator of claudeagents · Last reviewed
Claude Code agent teams let one Claude Code session act as a team lead that splits a job into tasks and hands them to several teammate sessions. Each teammate has its own context window, and teammates can message each other directly while they work through a shared task list.
It's the closest Claude Code gets to a small team of developers: a lead that plans and checks the work, and specialists that research, build or review in parallel. It's also experimental and switched off by default, and it uses a lot more tokens than one session, so it pays to know when it's worth it.
This guide covers how to turn agent teams on, how to start and steer your first team, how they differ from subagents, and the limits to know about. Everything is checked against Anthropic's agent teams docs on 21 November 2026.
What are agent teams in Claude Code?
An agent team is a group of Claude Code sessions working on one job. According to the docs, a team has four parts:
- The team lead: your main session. It plans the work, creates tasks, assigns them and pulls the results together.
- Teammates: separate Claude Code sessions, each with its own context window. They pick up tasks and do the work.
- A shared task list: every task is pending, in progress or completed, and tasks can depend on each other.
- A mailbox: teammates can send messages to each other and to the lead, so they can ask questions and share findings without going through you.
You can also talk to any teammate directly, not just the lead. That's the big difference from subagents: a team is a group that coordinates itself, not one assistant handing out errands.
Agent teams vs subagents
Both let Claude split work across separate context windows. The difference is who talks to whom, and what it costs:
| Subagents | Agent teams | |
|---|---|---|
| Who coordinates | Your main session manages all the work | Teammates organise themselves through a shared task list |
| Communication | Each subagent reports back to the caller only | Teammates message each other directly, and you can message any of them |
| Token cost | Lower: only a summary comes back | Higher: every teammate is a full Claude session |
| Status | Standard feature | Experimental, off by default |
| Best for | Focused tasks where only the result matters | Work that needs discussion and collaboration |
A simple test: if you'd be happy with a single report at the end, use a subagent. If the helpers need to argue, hand work to each other or check each other's output, use a team.
How to turn on agent teams
Agent teams are behind an environment variable. Set it in your shell, or put it in a settings file so it's always on. In ~/.claude/settings.json it looks like this:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}Set the value to "0" to switch it off again. Two things to know before you start: teams only spawn in an interactive session (not with claude -p or the Agent SDK), and while the feature is on, Claude may start a teammate on its own when it decides to use one of your named subagents.
How to start your first team
There's no slash command. You describe the job and the teammates you want in plain English, and the lead sets up the team. This is the example from Anthropic's docs:
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.The lead creates the tasks, spawns the three teammates and starts coordinating. A few more prompts that work well:
Useful prompts for steering a team
# Pick the number of teammates and their model
Spawn 4 teammates to refactor these modules in parallel. Use Sonnet for each teammate.
# Reuse one of your subagents as a teammate role
Spawn a teammate using the security-reviewer agent type to audit the auth module.
# Stop a teammate
Ask the researcher teammate to shut down.That second prompt is worth a closer look. Teammates can take on the role of any subagent you've defined in .claude/agents/. If you already have a security reviewer, a test writer or an SEO specialist set up as subagents, you can turn them into a team without writing anything new. (Our agent kits include 85 ready-made subagents you can use this way.)
Watching the team: in-process or split panes
By default, teammates run in-process: inside your one terminal, in any terminal app. An agent panel lists them. Use the arrow keys to move between teammates, Enter to open one, Escape to clear the selection, x to stop a teammate and Ctrl+T to show or hide the task list.
If you'd rather see every teammate side by side, use split panes. This needs tmux, or iTerm2 with its it2 command-line tool and Python API turned on. Set it in your settings:
{
"teammateMode": "auto"
}Other values are "tmux" and "iterm2". You can also try it for one session with claude --teammate-mode auto; the docs note that this flag is experimental and doesn't show up in claude --help.
When to use an agent team, and when not to
The docs point to four kinds of work where teams shine:
- Research and review: several teammates look at a problem from different angles, then challenge each other's conclusions.
- New modules or features with clear owners: each teammate builds its own part.
- Debugging with competing ideas: each teammate chases a different theory of what's wrong.
- Cross-layer work: one teammate on the frontend, one on the backend, one on tests.
Skip teams for step-by-step work where each task needs the previous one finished, for changes where two teammates would edit the same file, and for tightly connected code. A single session, or a session with subagents, handles those better and for fewer tokens.
Anthropic's tips for good results: start with research or review tasks before letting a team edit code, give each teammate around 5 to 6 tasks, and keep teammates out of each other's files.
What agent teams cost
The docs are direct about it: agent teams use significantly more tokens than a single session, and usage grows with every active teammate, because each one is a full Claude session with its own context. Anthropic suggests starting with 3 to 5 teammates.
Two ways to keep costs down: ask for a cheaper model for teammates ("Use Sonnet for each teammate"), and shut teammates down once their tasks are done rather than leaving them idle. On a subscription, a big team will eat into your usage limits faster; see our guide to Claude Code pricing for how the plans compare.
Current limitations
Because the feature is experimental, there are rough edges. The docs list these:
/resumeand/rewinddon't bring back in-process teammates.- Task status can lag, so a blocked task may need a nudge.
- Shutting a team down can be slow.
- One team per session, and teams can't be shared across sessions.
- No nested teams: teammates can't spawn their own teammates.
- In-process teammates can't run background subagents.
- The lead can't be handed to another session.
- Split panes need tmux or iTerm2.
Permissions and quality checks
Teammates start in the same permission mode as the lead, and you can't give each teammate its own mode when it spawns. When a teammate needs approval, the prompt shows up in the lead's session. If you're tired of approving the same safe commands, add allow rules first; our Claude Code permissions guide shows how.
You can also add quality gates with hooks. Agent teams add three hook events: TeammateIdle, TaskCreated and TaskCompleted. A hook that exits with code 2 sends feedback back and keeps the teammate working, or blocks the task from being created or marked done, which is a handy way to make sure tests pass before a task counts as finished.
Frequently asked questions
How do I enable agent teams in Claude Code?
Set the environment variable CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1, either in your shell or under env in ~/.claude/settings.json. Then start an interactive Claude Code session and ask it to spawn teammates.
What's the difference between agent teams and subagents?
Subagents report back only to the session that called them, and that session manages everything. In an agent team, teammates share a task list and message each other directly. Teams handle work that needs collaboration; subagents are cheaper for focused tasks.
How many teammates should I use?
Anthropic suggests starting with 3 to 5 teammates and about 5 to 6 tasks each. There's no hard limit, but every teammate is a full Claude session, so token use grows quickly.
Do agent teams work with claude -p or in CI?
No. Teammates only spawn in an interactive session. In print mode (claude -p) and the Agent SDK, teammates aren't started.
Can I use my own subagents as teammates?
Yes. Ask for a teammate using a subagent type by name, for example "Spawn a teammate using the security-reviewer agent type to audit the auth module."
Are Claude Code agent teams stable?
Not yet. They're experimental and off by default, with known issues around resuming sessions, task status and shutdown. Try them on research or review work first.
Sources
Skip the setup: get 85 ready-made agents
Coding, SEO and marketing kits for Claude Code, with 52 skills and 53 slash commands. $29 one-time, lifetime updates.
See what's included →