Skip to content
,

Claude Code Agent Teams (2026): How to Enable, Run and Manage a Team

7–11 minutes
Woman at a whiteboard holding a tablet with an AGENT TEAMS card, hook your AI dev team

Subagents let Claude hand off small jobs and get a summary back. Agent teams go further. They let one Claude Code session lead a group of full, independent Claude Code sessions that share a task list, message each other directly and work in parallel.

It is the closest thing to giving Claude a small dev team.

This guide shows you how to turn agent teams on, start your first team, pick models, use split panes in tmux or iTerm2, assign tasks, add quality gates with hooks, keep costs under control, and fix the common problems.

Agent teams are experimental, so it also lists the current limits. Everything follows Anthropic’s Claude Code documentation as of December 2026.

TL;DR

  • Enable: set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in the env block of settings.json.
  • Start: ask in plain words, for example “Spawn three teammates: one on UX, one on architecture, one devil’s advocate.”
  • Navigate: arrow keys pick a teammate, Enter opens it, Ctrl+T toggles the task list, x stops a teammate.
  • Split panes: set "teammateMode": "auto" and run inside tmux or iTerm2.
  • Team size: start with 3 to 5. Token use scales with every teammate.
  • Interactive only: teams do not spawn in -p mode.

What Agent Teams Are

An agent team has two roles:

  • The lead is your main session. It creates tasks, spawns teammates, assigns work and combines the results.
  • Teammates are separate Claude Code sessions, each with its own context window. They can message each other, claim tasks from a shared list and report back when they finish.

You can also talk to any teammate directly. The strongest use cases from the docs:

  • Research and review: several teammates look at different angles, then challenge each other.
  • New modules or features: each teammate owns a separate piece.
  • Debugging with competing hypotheses: teammates test different theories at once.
  • Cross-layer changes: frontend, backend and tests, each owned by someone.

Agent Teams vs Subagents

Subagents Agent teams
Context Own window; result returns to caller Own window; fully independent session
Communication Report back to the main agent 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 collaboration
Token cost Lower Higher; each teammate is a full instance

For quick, focused helpers, stick with Claude Code subagents. To run several sessions yourself without coordination, use Claude Code worktrees.

Enable Agent Teams

Teams are off by default. Add the flag to your settings file:

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

Or export it in your shell before starting claude. Our Claude Code settings guide shows where each settings file lives.

Two things change once it is on:

  • When Claude names a subagent on its own, that subagent launches as a teammate. Teams can form even if you did not ask for one.
  • Teams need an interactive session. In non-interactive -p mode and Agent SDK sessions, Claude does not spawn teammates.

Start Your First Team

  1. Describe the task and the roles in plain language. The docs’ 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.
  2. Watch the agent panel below the prompt. Each teammate gets a row.
  3. Open a teammate: use the up and down arrows to select it and press Enter to see its transcript and message it. Escape clears the selection or interrupts the teammate you are viewing.
  4. Check the task list with Ctrl+T.
  5. Let the lead combine results once teammates go idle. Each idle notice includes the teammate’s final answer.

If Claude uses subagents instead, ask again and request an “agent team” explicitly. Subagents show in the same panel, so the panel alone does not prove a team formed.

Use Split Panes in tmux or iTerm2

By default teammates run in-process inside your terminal. To give each one its own pane:

  1. Install tmux, or install the it2 CLI for iTerm2 and enable iTerm2 → Settings → General → Magic → Enable Python API.
  2. Set the mode in ~/.claude/settings.json:
    { "teammateMode": "auto" }
  3. Run claude inside tmux or iTerm2 and ask for teammates.

With "auto", panes open inside tmux or iTerm2 and fall back to in-process elsewhere. Use "tmux" to open panes in a separate tmux session (the prompt shows a View teammates command), or "iterm2" to force iTerm2 panes.

For one session, pass claude --teammate-mode auto. For tmux tips, see our Claude Code terminal setup guide.

Choose Teammate Models

Name the model in your prompt: “Spawn 4 teammates to refactor these modules in parallel. Use Sonnet for each teammate.” Claude Code picks each teammate’s model from the first of these that applies:

  1. The model named in your spawn prompt
  2. The model in a subagent definition the teammate was spawned from
  3. CLAUDE_CODE_SUBAGENT_MODEL, if set to something other than inherit
  4. The lead’s current model

Set CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 to make every teammate use CLAUDE_CODE_SUBAGENT_MODEL. The old teammateDefaultModel setting was removed and is ignored. A teammate’s model is fixed at spawn, and /model typed while viewing a teammate changes the lead, not the teammate. More on models in how to change the model in Claude Code.

You can reuse subagent definitions as teammate templates. Their tools, model and body apply, but their skills do not.

Tasks, Messages and Plans

  • Shared task list: tasks are pending, in progress or completed, and can depend on other tasks. The lead assigns tasks, or teammates self-claim the next unblocked one. File locking prevents two teammates from claiming the same task.
  • Messages: teammates message one another by name. To reach everyone, the sender messages each recipient.
  • Plan first: put the lead in plan mode before spawning, or ask for an “architect teammate”, and teammates plan before editing. Learn the mode in our Claude Code plan mode guide.
  • Shut down: “Ask the researcher teammate to shut down.” The teammate can accept or explain why not.

Team files live in ~/.claude/teams/{team-name}/ (config and mailboxes) and ~/.claude/tasks/{team-name}/ (task list). The team config is removed when the lead exits normally; the task list stays.

Quality Gates With Hooks

Three hook events let you enforce rules on the team. Exit with code 2 to block the action and send feedback:

Hook Runs when Exit 2 does
TeammateIdle A teammate is about to go idle Keeps it working with your feedback
TaskCreated A task is being created Prevents creation
TaskCompleted A task is being marked done Prevents completion, for example until tests pass

Our Claude Code hooks guide shows how to write hook scripts.

Prompts That Work Well

Parallel code review

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.

Competing hypotheses

Users report the app exits after one message instead of staying connected.
Spawn 5 agent teammates to investigate different hypotheses. Have them talk to
each other to try to disprove each other's theories, like a scientific
debate. Update the findings doc with whatever consensus emerges.

Feature split by layer

Build the export feature. Spawn three teammates: one owns the API in
src/api/export, one owns the UI in src/ui/export, one writes tests in
tests/export. Do not edit each other's folders.

Best Practices and Costs

  • Start with 3 to 5 teammates. The docs note three focused teammates often beat five scattered ones. With 15 independent tasks, three teammates is a good start.
  • Give context in the spawn prompt: folders, goals and constraints. Teammates do not see your earlier chat.
  • Size tasks well: one function, one test file or one review each. Too small wastes overhead; too big runs long without check-ins.
  • Avoid file conflicts: give each teammate its own files. Two teammates editing one file leads to overwrites.
  • Pre-approve common actions in permission settings, because teammate prompts bubble up to the lead.
  • Monitor and steer. Do not leave a team unattended for long.
  • Watch tokens. Cost scales roughly with the number of active teammates. Use teams for research, review and new features, not routine edits. See how to reduce Claude Code token usage.

Current Limitations

  • /resume and /rewind do not restore in-process teammates. Ask the lead to spawn new ones.
  • Task status can lag when a teammate forgets to mark a task done.
  • One team per session, no nested teams, and the lead cannot be changed.
  • Teammates cannot set their own permission mode at spawn.
  • In-process teammates cannot run background subagents.
  • Split panes need tmux or iTerm2.

Troubleshooting

Teammates do not appear

Look in the agent panel and press Enter on a row. Idle rows hide 30 seconds after the whole panel goes idle, and more than three idle teammates collapse into one row. The task may also be too simple for Claude to start a team.

Split panes do not open

Check that tmux is on your PATH, or that it2 is installed and the iTerm2 Python API is enabled.

Claude spawns teammates when you wanted subagents

The flag is on in a project, local or managed settings file. Settings precedence means any of them can turn it on.

A teammate stopped early

Open it, give it new instructions, or ask the lead to spawn a replacement.

Leftover tmux sessions

Close the panes in your tmux window. Outside tmux, panes live in a session named claude-swarm on a separate tmux server.

FAQ

How do I enable agent teams in Claude Code?

Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in your environment or in the env block of settings.json, then restart Claude Code.

What is the difference between agent teams and subagents?

Subagents report back to the main agent. Agent teams are independent sessions that share a task list and message each other directly.

How many teammates should I use?

Start with 3 to 5. There is no hard limit, but cost and coordination grow with each teammate.

Do agent teams cost more?

Yes. Each teammate is a full Claude instance with its own context, so token use scales with team size.

Can I use agent teams in headless mode?

No. Teammates only spawn in interactive sessions, not with -p or the Agent SDK.

Can teammates use different models?

Yes. Name the model in the spawn prompt or in a subagent definition.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman at a whiteboard holding a tablet with an AGENT TEAMS card, hook your AI dev team