# Claude Code Agent Teams: How to Set Them Up and When They're Worth It

By Ethan Rogers. Published 2026-11-25. 17 min read.
Canonical: https://ethanplus.ai/guides/claude-code-agent-teams

Claude Code agent teams let one Claude Code session act as a lead and spin up several teammates, each a full Claude Code instance with its own context window, that share a task list and message each other directly. It is the closest thing Claude Code has to an actual team working a problem instead of one agent with helpers.

I build AI agents and agent infrastructure for a living, and I'm rebuilding my agency, Plastix, to run on agents. So I care less about whether a feature is impressive and more about whether it holds up on real work and what it costs. Claude agent teams are useful, they are also still experimental, and they burn tokens fast. Here is how to set them up and how to tell when a team is worth it, based on Anthropic's docs as of November 25, 2026.

> **The short version**
>
> - Agent teams are **experimental and off by default**. Enable them with `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in your environment or the `env` block of `settings.json`.
> - Start a team by asking for one in plain language: "Spawn three teammates to..."
> - Teammates run **in-process** by default. Set `teammateMode` to `"auto"` and run inside tmux or iTerm2 to give each one its own pane.
> - Use a team when workers need to **talk to each other**. Use subagents when you just need results back.
> - Expect **much higher token use**. Anthropic puts it at roughly 7x a standard session when teammates run in plan mode.

## What Claude Code agent teams are

An agent team has four parts, per the [agent teams docs](https://code.claude.com/docs/en/agent-teams):

- **Team lead.** Your main Claude Code session. It spawns teammates, creates tasks and synthesizes results. It stays the lead for the life of the session.
- **Teammates.** Separate Claude Code instances, each with its own context window. They load your project context (CLAUDE.md, MCP servers, skills) but not the lead's conversation history.
- **Task list.** A shared list of work items with three states: pending, in progress and completed. Tasks can depend on other tasks, and teammates can claim unblocked work on their own.
- **Mailbox.** The messaging system. Any teammate can message any other by name, and you can talk to any teammate directly without going through the lead.

The difference from ordinary delegation is that last part. Teammates coordinate with each other. They can share findings, challenge each other and pick up the next task without the lead micromanaging every handoff.

## Agent teams vs subagents

Claude Code subagents and agent teams both run work in parallel in separate context windows. They differ in who talks to whom and what it costs.

| | Subagents | Agent teams |
| --- | --- | --- |
| Status | Generally available | Experimental, off by default |
| Context | Own context window; results return to the caller | Own context window; fully independent |
| Communication | Report a result back to the main agent. Named subagents can message each other | Teammates message each other directly, and you can message any of them |
| Coordination | Main agent manages all the work | Self-coordination through messages and a shared task list |
| Can they nest? | Yes, by default up to three layers below the main conversation | No. Teammates can't spawn their own teammates |
| Worktree isolation | Yes, with `isolation: worktree` | Not offered for teammates. Split the work by file instead |
| Token cost | Lower: results are summarized back | Higher: each teammate is a full Claude instance |
| Best for | Focused tasks where only the result matters | Work that needs discussion, debate or cross-checking |

The rows on nesting and worktrees come from the [subagents docs](https://code.claude.com/docs/en/sub-agents) and the limitations section of the agent teams page. The rest is Anthropic's own comparison.

There is a third option worth knowing about: running several Claude Code sessions yourself, each in its own git worktree, with `claude --worktree <name>`. That gives you full file isolation and no automated coordination. Anthropic also now has cross-session messaging, which lets those separate sessions pass findings to each other without forming a team.

## When to use agent teams (and when not to)

Anthropic lists four strong use cases, and they match my experience of where parallel agents pay off:

- **Research and review.** Several teammates investigate different angles at once, then share and challenge each other's findings.
- **New modules or features** where each teammate can own a separate piece without touching the others' files.
- **Debugging with competing hypotheses.** Teammates each test a theory and try to disprove the others.
- **Cross-layer changes** where frontend, backend and tests are each owned by a different teammate.

Skip the team when:

- **The work is sequential.** If step two needs step one's output, parallel agents just wait on each other.
- **Everyone needs the same files.** Two teammates editing one file leads to overwrites.
- **The task is routine.** Anthropic's own guidance is that a single session is more cost-effective for routine work.
- **You only need answers back.** If the workers never need to talk to each other, subagents do the job for less.

My rule of thumb: if I can describe the job as "go find out X and tell me," that's a subagent. If it's "you three figure this out together and argue until you agree," that's a team.

## What you need before you start

- **Claude Code installed and signed in.** If you haven't done that yet, see [how to install Claude Code](/guides/how-to-install-claude-code).
- **An interactive session.** Teammates don't spawn in non-interactive mode (`claude -p`) or in Agent SDK sessions.
- **Room in your plan or budget.** Each teammate uses tokens independently. On a subscription that comes out of your usage limits; on an API key it comes off your bill. More on that in the cost section, and in [Claude Code pricing](/guides/claude-code-pricing).
- **Optional: tmux or iTerm2** if you want each teammate in its own pane.
- **A task with clean boundaries.** This matters more than any setting.

## Step 1: Enable the experimental flag

Agent teams are disabled by default. Turn them on by setting the `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` environment variable to `1`. The cleanest way is in `settings.json` (for example `~/.claude/settings.json` for all your projects):

```json
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}
```

Or for one shell session:

```bash
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
claude
```

One side effect the docs call out: while agent teams are enabled, any subagent that Claude gives a name to launches as a teammate. Claude sometimes names subagents on its own, so teams can form even when you didn't ask for one. If that's not what you want, set the variable back to `0`. Claude Code reapplies settings-file `env` values to the running session when you save, so you don't need to restart.

## Step 2: Start your first agent team

Describe the task and the teammates you want in plain language. This is the example from Anthropic's docs, and it works because the three roles are independent:

```text
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.
```

Claude creates a shared task list, spawns the teammates, lets them work and synthesizes the findings at the end.

A few prompt patterns I'd use from day one:

- **Name the teammates.** "Call them researcher, builder and reviewer." Predictable names make every later instruction easier.
- **Name the model.** "Use Sonnet for each teammate." Otherwise teammates default to the lead's model, which may be your most expensive one.
- **Give each one context.** Teammates don't see your conversation with the lead. Put the file paths, constraints and goal in the spawn prompt.
- **Reuse a subagent definition.** "Spawn a teammate using the security-reviewer agent type to audit the auth module." The teammate picks up that definition's tools, model and instructions.

If Claude uses subagents instead of creating a team, ask again and explicitly request an agent team. Subagents show up in the same agent panel, so the panel alone doesn't prove a team formed.


## Step 3: Navigate and talk to teammates

In the default in-process mode, teammates are listed in the agent panel below your prompt:

- **Up and down arrows** select a teammate.
- **Enter** opens that teammate's transcript so you can message it directly.
- **Escape** clears the selection. While you're viewing a teammate, Escape interrupts its current turn.
- **x** stops the selected teammate.
- **Ctrl+T** toggles the task list.

While viewing a teammate, plain text and skills go to that teammate, but built-in commands like `/compact` and `/clear` act on the lead's conversation, and Claude Code asks you to confirm before running those from that view. A teammate's model and fast mode are fixed when it spawns.

Idle teammates stay addressable even when their row hides. If more than three are idle, the extras collapse into a single `N idle agents` row that Enter expands.

## Step 4: Choose a display mode (in-process, tmux or iTerm2)

There are two display modes:

- **In-process** (default): all teammates run inside your main terminal. Works in any terminal.
- **Split panes**: each teammate gets its own pane, so you can watch everyone at once and click into a pane to interact. Requires tmux, or iTerm2 with the [`it2` CLI](https://github.com/mkusaka/it2).

To use split panes:

1. **Install tmux** with your package manager, or for iTerm2 install the `it2` CLI and enable **iTerm2 > Settings > General > Magic > Enable Python API**.
2. **Set `teammateMode` to `"auto"`** in `~/.claude/settings.json`:

```json
{
  "teammateMode": "auto"
}
```

3. **Run `claude` inside tmux or in iTerm2**, then ask for teammates.

With `"auto"`, teammates open in split panes inside tmux or iTerm2 and run in-process everywhere else. Two other values exist: `"tmux"` opens panes in a separate tmux session when you're not running inside tmux (copy the command from the `View teammates` line to watch them), and `"iterm2"` forces iTerm2's own panes. For one session, pass `claude --teammate-mode auto`. Anthropic notes that this flag is experimental and doesn't appear in `claude --help`.

Anthropic suggests `tmux -CC` in iTerm2 as the best way into tmux on a Mac, and notes tmux has known limitations on some operating systems.


## Step 5: Plan first, assign work, enforce quality

For anything risky, put the lead in plan mode (Shift+Tab) before asking for a teammate. A teammate spawned while the lead is in plan mode also plans first, then sends a plan approval request. One detail that surprised me in the docs: if you haven't changed that teammate's permission mode, Claude Code approves the plan automatically as soon as the request arrives. If you want the lead to actually review plans, switch the running teammate into plan mode yourself with Shift+Tab while viewing it.

For task assignment, you can tell the lead who gets what, or let teammates self-claim the next unassigned, unblocked task when they finish. Claiming uses file locking, so two teammates don't grab the same task.

For quality gates, three hooks are built for teams:

- **`TeammateIdle`** runs when a teammate is about to go idle. Exit with code 2 to send feedback and keep it working.
- **`TaskCreated`** runs when a task is being created. Exit 2 to block it.
- **`TaskCompleted`** runs when a task is being marked complete. Exit 2 to reject it, for example when tests fail.

## Step 6: Shut the team down

Refer to teammates by name: "Ask the researcher teammate to shut down." The lead sends a shutdown request, and the teammate can approve and exit or decline with a reason. Shut teammates down as soon as their work is done, because an active teammate keeps consuming tokens until it exits or the session ends.

The team config is removed when the session ends. The task list stays on disk under `~/.claude/tasks/` until Claude Code's normal cleanup removes it.

## How you know it worked

- **Teammates appear in the agent panel** (or in their own panes), with names you can select.
- **The task list fills in** when you press Ctrl+T, and tasks move from pending to in progress to completed.
- **Teammates reference each other's findings**, which is the whole point. If every teammate reports in isolation and never mentions the others, you probably got subagents.
- **The lead synthesizes** a final answer that draws on all of them.

## Tmux, git worktrees and file conflicts

This is the part most guides get wrong, so to be precise about what the docs say.

**Tmux is only about display.** It decides whether you see teammates in panes. It doesn't isolate their files.

**Teammates don't get their own worktrees.** The agent teams docs don't offer worktree isolation for teammates, and their guidance on file conflicts is to break the work up so each teammate owns a different set of files. In the docs' own words, "Two teammates editing the same file leads to overwrites."

If you need real file isolation, you have two documented options:

- **Subagents with `isolation: worktree`.** Each runs in a temporary git worktree under `.claude/worktrees/`, branched from your default branch unless you set `worktree.baseRef` to `"head"`.
- **Separate sessions with `claude --worktree <name>`**, one per terminal, coordinated by you or by cross-session messaging.

In practice I'd use a team for the thinking (research, review, debate) and either strict file ownership or worktree-isolated subagents for parallel edits.

## An illustrative example: a site build split into three roles

To be clear up front, this is an illustrative example of how I'd structure a team for the kind of work I do, not a write-up of a past project with measured results.

Say I'm building a marketing site for a client: a Next.js app with a handful of service pages, a blog and a contact form. The work splits naturally into research, implementation and review, and those roles have different needs.

**The setup.** Lead on Opus 5.5 in plan mode. Teammates on Sonnet to keep the cost down. A `TaskCompleted` hook that runs the build and the test suite and rejects any task that fails.

**The spawn prompt:**

```text
We're building the marketing site described in docs/brief.md.
Spawn three teammates, all on Sonnet:
- "researcher": read the brief and the client's current site, then write
  docs/content-plan.md with page structure, headings and the facts each
  page needs. Don't touch app/ or components/.
- "builder": once content-plan.md exists, build the pages in app/(site)/
  and shared pieces in components/. You own those two folders only.
- "reviewer": review each page the builder finishes for accessibility,
  broken links and copy that contradicts the brief. Message the builder
  directly with fixes. Don't edit files.
Create tasks with dependencies so the builder's tasks wait on the
content plan. Wait for all three before summarizing.
```

**Why this shape.** Each teammate owns a different set of files, which handles the overwrite problem without worktrees. The dependency between the content plan and the build tasks uses the task list the way it was designed to. And the reviewer messaging the builder directly is the thing a team does that subagents can't do cheaply: the feedback loop runs between the two of them instead of bouncing through the lead.

**What I'd watch for.** The lead starting to implement pages itself instead of waiting (the docs suggest telling it to "Wait for your teammates to complete their tasks before proceeding"), task status lagging after a teammate finishes, and the reviewer drifting into editing files it was told not to touch.

**What I'd do differently for a bigger build.** Past three or four teammates, I'd split implementation into worktree-isolated subagents and keep the team for research and review. That's also how I think about agents running parts of a company more broadly: clear ownership first, coordination second. I wrote about that ordering in [how companies actually start running on agents](/blog/how-companies-actually-start-running-on-agents).

## What agent teams cost in tokens

Short answer: a lot more than one session.

From the [agent teams page](https://code.claude.com/docs/en/agent-teams) and the [Claude Code costs page](https://code.claude.com/docs/en/costs):

- **Each teammate is a separate Claude instance** with its own context window, so token use scales roughly linearly with team size and with how long each teammate runs.
- **Anthropic estimates about 7x the tokens of a standard session** when teammates run in plan mode.
- **Teammate prompt caches hold for five minutes by default**, including on a subscription, because in-process teammates fall outside the main conversation's cache bucket. Set `subagentPromptCacheTtl` to `1h` to keep them warm longer. On the API, 1-hour cache writes cost more, so that's a tradeoff, not a free win.

Anthropic's cost advice for teams, which I agree with:

- **Use Sonnet for teammates.** Save the expensive model for the lead.
- **Keep teams small.** Start with 3 to 5 teammates. Anthropic notes three focused teammates often beat five scattered ones.
- **Keep spawn prompts focused.** Everything in the prompt sits in the teammate's context from the start.
- **Size tasks right.** About 5 to 6 tasks per teammate keeps everyone busy without long unsupervised runs.
- **Shut teammates down** when they're done.

If you're on a subscription, a team draws down your usage limits faster. Run `/usage` to see where it's going. If you're on an API key, the same command shows an estimated session cost in dollars.

## Common problems and fixes

| Problem | Fix |
| --- | --- |
| No teammates appear | Check the agent panel below the prompt and use the arrow keys. Confirm the flag is set to `1`. Make the task big enough to warrant a team, or ask for one explicitly. |
| Claude used subagents instead of a team | Ask again and explicitly request an agent team. |
| Teams form when you didn't ask | Named subagents launch as teammates while the flag is on. Set `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` to `0`. |
| Split panes don't open | Run `which tmux`. For iTerm2, install `it2` and enable the Python API. Set `teammateMode` to `"tmux"` or `"iterm2"` if `"auto"` doesn't pick it up. |
| Too many permission prompts | Teammate prompts bubble up to the lead. Pre-approve common commands in your permission settings before spawning. |
| Teammates overwrite each other | Give each teammate its own files, or move parallel edits to worktree-isolated subagents. |
| A teammate stops early after an error | Open its transcript, give it more instructions, or spawn a replacement. |
| The lead declares victory too soon | Tell it to keep going, or to wait for teammates to finish. |
| A task looks stuck | Task status can lag. Check whether the work is done and update it, or have the lead nudge the teammate. |
| Teammates gone after `/resume` | In-process teammates aren't restored on resume. Ask the lead to spawn new ones. |
| Leftover tmux session | `tmux ls`, then `tmux kill-session -t <session-name>`. |

## Fine print and limitations

Per the docs, as of November 25, 2026:

- **Experimental.** Behavior, settings and the flag name can change. Check the [agent teams page](https://code.claude.com/docs/en/agent-teams) before relying on anything here.
- **One team per session**, and no nested teams. Only the lead manages the team, and you can't hand leadership to a teammate.
- **No per-teammate permission modes at spawn.** Teammates start in the lead's mode, including `bypassPermissions` if you launched with `--dangerously-skip-permissions`. Be careful with that combination.
- **Teammates can't approve things on your behalf.** Messages between agents are marked as coming from another Claude session, so a teammate can't supply consent or route around a denied permission.
- **No background subagents from in-process teammates.** Their subagents run in the foreground.
- **Shutdown can be slow**, because teammates finish their current request first.

## Frequently asked questions

### Are Claude agent teams still experimental?

Yes. As of November 25, 2026, Anthropic's docs describe agent teams as experimental and disabled by default, with known limitations around session resumption, task coordination and shutdown.

### How do I enable Claude Code agent teams?

Set `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` to `1`, either in your shell or in the `env` block of `settings.json`. Then start an interactive session and ask Claude to spawn teammates.

### What is the difference between Claude Code subagents and agent teams?

Subagents do a focused job and report a result back to the main agent. Agent team teammates are full, independent Claude Code sessions that share a task list and message each other directly. Teams cost more and suit work that needs discussion; subagents suit work where only the result matters.

### How many teammates should a Claude agent team have?

Anthropic recommends starting with 3 to 5 for most workflows. There's no hard limit, but token costs scale with team size and coordination gets harder past that.

### Do I need tmux for Claude Code agent teams?

No. The default in-process mode works in any terminal. You only need tmux, or iTerm2 with the `it2` CLI, if you want each teammate in its own split pane.

### Do agent team teammates use git worktrees?

Not by default, and the agent teams docs don't offer worktree isolation for teammates. Give each teammate its own files, or use subagents with `isolation: worktree` or separate `claude --worktree` sessions when you need isolated edits.

### How much more do Claude agent teams cost?

Each teammate uses tokens independently, so cost grows with team size and runtime. Anthropic estimates about 7x the tokens of a standard session when teammates run in plan mode. Use Sonnet for teammates and shut them down when they finish.

### Can I use agent teams with claude -p or the Agent SDK?

No. Spawning teammates requires an interactive session. In non-interactive mode, a named subagent runs as an ordinary subagent even with the flag on.

## Want agents running parts of your company?

Agent teams are a good preview of where this is going: several agents with clear roles, shared state and a way to check each other's work. Getting that to hold up on real business work takes more than a flag. It takes clear ownership, the right model in each seat and guardrails on cost and permissions. That's the work I do with companies, and I teach the hands-on side in [Claude Code training](/claude-code-training). If you want agents running real parts of your business, [let's talk](/contact). If your agents need access to your own tools first, start with [connecting apps to Claude with MCP](/guides/connect-apps-to-claude-mcp).
