CLClaude Lessons Try the free lessons

Claude Lessons / Guides

Claude Code Agent Teams: Run a Team of Claude Sessions in Parallel

Agent teams turn one Claude Code session into a team lead that spawns full, independent Claude instances — each with its own context window — coordinates them through a shared task list, and lets them message each other directly. It's the difference between delegating errands and running a standup. The feature is experimental, hidden behind an environment variable, and expensive when used carelessly; it is also the closest thing Claude Code has to genuine parallel collaboration, and for the right tasks (parallel code review, debugging with competing hypotheses) it beats a solo session decisively. This guide covers enabling it, when a team beats subagents, how coordination actually works under the hood, and the limitations you'll hit.

Illustration of a team of Claude Code agents working in parallel

What agent teams are

An agent team has four parts: a lead (your main session, which spawns teammates and coordinates), teammates (separate, full Claude Code instances), a shared task list (work items teammates claim and complete, with dependencies), and a mailbox (a per-agent message queue on disk that agents use to talk to each other).

The properties that make this different from everything else in Claude Code:

Agent teams vs. subagents

Both parallelize work. The decision hinges on one question: do the workers need to talk to each other?

SubagentsAgent teams
ContextOwn window; result returns to the callerOwn window; fully independent session
CommunicationReport back to the main agent onlyTeammates message each other directly
CoordinationMain agent manages all workShared task list + self-coordination
You can interact withThe main agentAny teammate, individually
Token costLower — results summarized into one contextHigher — every teammate is a full instance
Best forFocused tasks where only the result mattersWork that benefits from discussion and challenge

Rule of thumb: research-with-a-report → subagent. Review-with-a-debate, or a feature whose frontend, backend, and tests can proceed independently → team. Sequential work with many dependencies → neither; a single session with a good plan beats both. (If what you actually want is several isolated sessions that never interact, that's git worktrees, not agent teams — one worktree per session, no coordination overhead.)

Enabling agent teams

Agent teams are experimental and disabled by default. Enable them with one environment variable, either in your shell or in settings.json:

{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

Three things to know before flipping it:

Your first team, step by step

With the flag set, you just describe the team in natural language. A prompt that works well:

Spawn three teammates to review PR #142:
- One focused on security implications
- One checking performance impact
- One validating test coverage
Have them each review and report findings, then synthesize.

The lead populates the shared task list, spawns a teammate per role, and synthesizes when they finish. Teammates appear in the agent panel below the prompt input. The keys that matter:

KeyIn the agent panel
/ Select a teammate
EnterOpen its transcript and message it directly
EscInterrupt its current turn
xStop the selected teammate
Ctrl+TToggle the shared task list

Prompting details that improve results immediately:

In-process vs. split panes

ModeWhat you seeRequires
in-process (default)All teammates inside your main terminal, via the agent panelNothing — works in any terminal
Split panesEach teammate in its own live pane; click into any of themtmux, or iTerm2 with the it2 CLI

Set it with "teammateMode" in ~/.claude/settings.json or per-session with claude --teammate-mode auto. The values: "in-process", "auto" (split panes when you're already inside tmux or in iTerm2 with it2 installed, in-process otherwise), "tmux", or "iterm2". Two gotchas: the default changed to in-process in v2.1.179, so if your teams used to open panes and stopped, set "auto" explicitly; and split panes don't work in VS Code's integrated terminal, Windows Terminal, or Ghostty — in-process works everywhere.

How coordination actually works

Knowing the mechanics helps you debug a confused team instead of restarting it.

Practice multi-agent delegation hands-on

Claude Lessons has free interactive lessons on agent teams, delegating to subagents, and running parallel sessions — practiced in a simulated Claude Code workspace, with feedback on how you scope and verify the work.

Start the free interactive lessons

Steering a running team

The failure mode of unattended teams isn't chaos, it's waste: a teammate stuck on an error, a lead that started implementing tasks itself, work drifting from the goal while nobody checks. Steering is the job you keep.

Permissions and safety

When a team pays off — and when it doesn't

Token cost scales linearly with team size — each teammate is a full instance with its own context. So the question is always: does parallelism add information, or just add agents? Four patterns clear the bar:

Sizing guidance from the docs, which matches our experience: start with 3–5 teammates; give the lead 5–6 tasks per teammate; make tasks self-contained units with a clear deliverable. Skip teams entirely for sequential work, same-file edits, or anything routine — and if you're new to them, start with research and review tasks, which show the value without the merge conflicts. For the budgeting side of running several full contexts at once, see the token usage and costs guide.

Limitations and troubleshooting

Current limitations (this is an experimental feature and these change fast):

And the diagnostic that solves most "it's not working" reports: teammates not appearing usually means the task was too simple to warrant a team (Claude decides), the panel hid idle rows (message a teammate by name to bring it back), or tmux isn't installed but split panes were requested (which tmux).

FAQ

What are agent teams in Claude Code?

Agent teams coordinate multiple full Claude Code instances working on one problem. Your session becomes the team lead: it spawns teammates, breaks work into a shared task list, and synthesizes results. Each teammate is an independent session with its own context window that loads your project context (CLAUDE.md, MCP servers, skills), claims tasks, and messages the lead and other teammates directly. Unlike subagents, teammates talk to each other — and you can talk to any of them individually.

How do I enable agent teams?

Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in your shell or in settings.json under the env key, then describe the team you want in natural language. No other setup step exists on current versions; team directories are created at session start and cleaned up at exit.

What's the difference between agent teams and subagents?

Subagents run within your session, report results only to the main agent, and never talk to each other — cheaper and right for focused tasks where only the result matters. Teammates are fully independent sessions that share a task list and message each other — heavier, and right for work that benefits from discussion: parallel reviews, competing-hypothesis debugging, features with clean seams. When in doubt, start with a subagent; upgrade to a team when you catch yourself wanting the workers to compare notes.

Do agent teams use more tokens?

Yes — roughly linearly with team size, since every teammate carries a full context window. Worth it for parallel research, review, and independent feature work; not worth it for routine or sequential tasks. Using Sonnet teammates under an Opus lead ("use Sonnet for each teammate") is the easiest cost lever.

Why is Claude spawning teammates when I didn't ask for a team?

While agent teams are enabled, any subagent Claude names launches as a teammate — and Claude names subagents on its own. If that stalls a flow that waits on subagent results, set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=0 in settings; it applies from the next spawn without a restart.

Can teammates work in the same files?

They can, and it ends in overwrites — task claiming is lock-protected, file editing is not. Give each teammate exclusive ownership of its files in the task descriptions, or keep implementation solo and use the team for research and review. For hard isolation between parallel sessions, git worktrees (one directory and branch per session) remain the manual alternative.

Learn to delegate before you scale it

Claude Lessons has 38 free interactive lessons — including agent teams, subagent delegation, and parallel sessions with worktrees — all practiced hands-on in a simulated Claude Code workspace.

Practice hands-on in the free interactive lessons