# Claude Code Agent Teams: How the Feature Works, and What Changes at Fleet Scale

> Experimental Claude Code agent teams: setup, teammate coordination, shared tasks, verification, and what changes for unattended fleets.

- Canonical: https://jedarden.com/guides/claude-code-agent-teams/
- Published: 2026-10-26
- Last verified: November 30, 2026 (2026-11-30)
- Tags: agents, claude-code, agent-teams, fleet-ops

---

**Claude Code agent teams put several coding sessions under one lead.** One
session becomes the team lead: it spawns named teammates, hands out work,
and synthesizes the results. In sessions with the Task tools, it uses a shared
task list; otherwise agents coordinate by messages. Each teammate is a
full Claude Code instance with its own context window, and teammates message
each other directly instead of routing everything through you.

> **TL;DR** — Agent teams are experimental and disabled by default; you enable
> them with `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, and the documentation's
> own advice is to start with 3–5 teammates. There is no documented hard
> teammate cap; token use grows with the active teammates. The feature as documented assumes a person is
> watching the panel. I run about twenty coding agents unattended, and the
> parts of the docs that read as footnotes — task status that can lag, no
> restoration of in-process teammates on resume, messages between agents treated as untrusted — are the
> load-bearing walls at that scale. First half of this guide: the feature as
> Claude Code currently documents it. Second half: what actually changes when
> the team is big and unsupervised — dispatch, claims, verification, and cost.

Everything in the feature-description half was verified against [Claude Code's
agent teams documentation](https://code.claude.com/docs/en/agent-teams/) on
**2026-11-30**. It is an experimental feature and the details move — the page
itself calls out behavior changes across point releases — so treat that access
date as part of the citation and re-verify anything you build on. The
fleet-scale half comes from running about twenty headless coding agents, which
I have written up as [a failure taxonomy](/notes/what-breaks-at-twenty-agents/)
and as [an architecture](/guides/agent-orchestration/). The short version of
that experience: when you run many agents, almost nothing that breaks is the
model.

## What are Claude Code agent teams?

Agent teams coordinate multiple Claude Code instances working together. The
current documentation names four components:

| Component | What the docs say it does |
| --- | --- |
| Team lead | Your main session. Spawns teammates, coordinates work, synthesizes results. |
| Teammates | Separate Claude Code instances, each with its own context window, that work on assigned tasks. |
| Task list | Shared work items for agents with the Task tools; others coordinate by messages. |
| Mailbox | Messaging system for communication between agents — one JSON inbox file per agent. |

The division of labor is the point. A [subagent](https://code.claude.com/docs/en/sub-agents/)
does focused work and returns a result to the caller. Named subagents can
also message each other now; messaging alone does not identify a team. A teammate stays
alive, holds its own context, and coordinates with the other teammates
through messages and, where available, the shared task list. The docs' comparison boils down to: use subagents when
only the result matters; use agent teams when the workers need to share
findings, challenge each other, and coordinate on their own.

The docs are equally blunt about the price: agent teams add coordination
overhead and use *significantly more tokens* than a single session, because
every teammate is a separate instance. Before reaching for a team, they point
at two lighter tools — [subagents](https://code.claude.com/docs/en/sub-agents/)
for in-session delegation and
[cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging/)
for passing findings between sessions you drive yourself.

The documented sweet spots are tasks where parallel exploration adds value:
research and review from independent lenses, new modules where each teammate
owns a separate piece, debugging with competing hypotheses, and cross-layer
work spanning frontend, backend, and tests. The documented anti-patterns are
sequential tasks, same-file edits, and work with many dependencies — all
places where coordination cost buys nothing.


<div data-agent-teams-exhibit="lifecycle">

**A team lifecycle, with a verification gate.** This is a schematic of the
documented workflow plus my artifact check, not a timing measurement.

| Stage | Boundary |
| --- | --- |
| Lead sets the boundary | Give each teammate a deliverable, files, evidence requirements, and a stopping point. |
| Teammates work and message | Separate contexts; share findings with peers and the lead. |
| Coordinate available work | With Task tools: shared list and file-locked claims. Without them: messages. Blocked tasks are excluded from self-claiming, but lead/user assignment is still possible. |
| Verify the artifact | Check the actual result before accepting completion; an agent summary is evidence to investigate. |
| Request shutdown | Ask named teammates to stop; requests can take time, and session end cleans up the team configuration. |

</div>

## How do you enable and start a team?

Agent teams ship disabled. Enable them with an environment variable or in
`settings.json`:

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

Enabling changes ordinary delegation, which surprised me on first read: while
the flag is on, a subagent that Claude *names* launches as a teammate — so
teams can form even when you asked for a subagent, or didn't ask for anything
multi-agent at all. Named calls that fork the conversation or pass `isolation`
on the Agent call remain subagents. Setting the variable to `0` turns the behavior off again,
and per the docs you don't need to restart the session for that. Spawning
teammates also requires an interactive session: in headless mode (`claude -p`)
and Agent SDK sessions, Claude never spawns teammates, and a named subagent
stays an ordinary subagent even with the flag on. That single sentence in the
docs rules out most unattended use — more on that below.

Starting a team is a natural-language prompt. For a first run, I would use a
read-only review with clear boundaries:

```text
Create an agent team with three teammates named security, performance,
and tests. Review the current change without editing files. Give each
teammate one of those review lenses. Report file locations, evidence, and
uncertainties; reconcile conflicting findings before the final summary.
```

This is a suggested prompt, not a measured benchmark. Start with a change
you can inspect yourself. Claude launches a teammate when it calls
the Agent tool with a name while the flag is enabled (subject to the fork
and isolation exceptions), without a confirmation prompt. In sessions with
the Task tools, it coordinates work through the shared task list. The agent
panel also shows ordinary subagents, so a row alone does not prove a team formed.

Two display modes exist. **In-process** (the default) runs every teammate
inside your terminal, with an agent panel for selecting a teammate, reading
its transcript, and messaging it directly. **Split panes** gives each teammate
its own tmux or iTerm2 pane; the docs set that with a `teammateMode` setting
(`"auto"`, `"tmux"`, or `"iterm2"`) or a `--teammate-mode` flag, and note that
the flag is experimental enough not to appear in `claude --help`. With `"auto"`, split panes open inside tmux or iTerm2 and other terminals
use in-process mode. With tmux installed, forcing `"tmux"` outside either
terminal opens a separate tmux session; use the displayed `View teammates`
command to watch it. The default in-process mode works in any terminal.

The panel has its own physics worth knowing before you run a real team: an
idle teammate's row hides 30 seconds after everything goes idle (the teammate
is still running and addressable), and when more than three teammates are idle
the surplus rows collapse into a single `N idle agents` row. At three
teammates this is trivia. At ten it is the difference between "the panel is
empty" and "everything is fine" — a small example of the general rule that
fleet UIs are sized for fleets of three.

**Check Task-tool availability before relying on that list.** Current Claude
Code does not provide the task-tracking tools by default on every model. For
a team where every worker should have them, the documented settings route is:

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

Use settings rather than only exporting the second variable in your shell:
split-pane teammates do not inherit that exported variable, but do receive
the settings environment. An explicit `--tools` list or deny rule can still
remove individual tools. If you have set `CLAUDE_CODE_ENABLE_TASKS=0`, clear
that override too: it substitutes `TodoWrite` for the four Task tools. See the
[Task-tool availability reference](https://code.claude.com/docs/en/tools-reference#task-tool-availability).

## How do teammates claim work without colliding?

For agents with the [Task tools](https://code.claude.com/docs/en/tools-reference#task-tool-availability),
the shared task list is the coordination surface; others use messages. Tasks have three states —
pending, in progress, completed — and can depend on other tasks. The docs are
specific about the mechanics:

- Teammates do **not self-claim blocked tasks**. You or the lead can still
  explicitly assign one, so dependency edges are not an absolute enforcement
  barrier. Completing prerequisites unblocks dependents.
- The lead can assign tasks explicitly, or teammates **self-claim**: after
  finishing, a teammate picks up the next unassigned, unblocked task.
- **Task claiming uses file locking** to prevent race conditions when multiple
  teammates try to claim the same task simultaneously.

That file lock is the right primitive, and it is necessary. It is not
sufficient once the team gets bigger or runs longer, because the lock answers
exactly one question: when two live teammates race for task 4, who wins. It
does not answer the two questions that dominate a fleet's incident log.

**Who reclaims a dead teammate's claim?** The docs' limitations section
concedes the raw material for this failure: `/resume` and `/rewind` do not
restore in-process teammates, and "task status can lag" — teammates sometimes
fail to mark tasks completed, which blocks dependent tasks. So the failure
shape exists in the documented feature: a task stuck in progress, its claimant
gone or silent, dependents blocked. My fleet's version of this ran for months
before I fixed it — [claims outliving their
workers](/notes/what-breaks-at-twenty-agents/#7-the-claims-that-leak) — and the
fix was not a better lock. It was a lease: a claim carries an owner and a
liveness check, and a claim whose owner cannot be reached is *reconciled*, not
waited on. The [state-and-claims section of my orchestration
guide](/guides/agent-orchestration/#state-claims-retries-and-idempotency) covers
why an abandoned claim is neither done nor available, and [the atomic-claims
chapter of the workflow manual](/guides/workflow/#s07-atomic-claims) shows the
claim protocol that made this boring.

**Is the completion real?** File locking serializes the *claim*; the
*completion* is still a teammate's self-report. The docs give you an
enforcement point — the `TaskCompleted` hook, where exit code 2 rejects the
completion and sends feedback — and that is the right place to hang real
verification, which is its own section below.

## What changes when nobody is watching the panel?

The docs ask you to monitor progress, redirect unproductive work, and
reconcile the findings. They warn that long unattended runs can waste effort. That is an honest boundary, and it is the exact seam between the
documented feature and fleet operation. Four things change when the person
leaves the panel.

**The spawn prompt is the teammate's entire world.** Teammates load project
context — CLAUDE.md, MCP servers, skills — but the docs are explicit that the
lead's conversation history does not carry over. Whatever the teammate needs
beyond the repo has to be in the spawn prompt. This is the same rule I learned
running replaceable workers: [the plan is the
prompt](/notes/plan-is-the-prompt/) — a worker can only reconstruct what was
written down for it, so the write-down is the work. A teammate spawned with
"review the auth module" inherits your taste for scope only if the prompt
carries it.

**Launch is not arrival.** The docs' troubleshooting section opens with
"teammates not appearing" — which tells you the documented feature already
knows a requested teammate may simply not materialize. Scale that up and it
becomes my first fleet incident: [the fleet you launch is not the fleet you
get](/notes/what-breaks-at-twenty-agents/#1-the-fleet-you-launch-is-not-the-fleet-you-get)
— fifteen workers requested, fewer actually running, and no error marking the
difference. The rule I operate: stagger launches and count what actually
started, never what was requested. The docs' advice to give teammates
predictable names helps here; a named teammate you never received is at least
auditable.

**Failure needs an owner, not a notification.** The documented behavior is
that an idle teammate notifies the lead, including its final answer — and that
a teammate whose turn ended on an API error notifies the lead *with the error
text*. That is the right wiring. But the lead is also a Claude session, and at
fleet scale the question becomes: who reads the lead's inbox at 3 a.m.? In my
setup the answer is an outcome handler that classifies each ending — verified
completion, agent failure, broken gate, provider outage — because each needs a
different response, and a stack of identical "teammate X failed" notifications
is not a response. The same goes for retries: unbounded restart of a
structurally impossible task is [the death
loop](/notes/what-breaks-at-twenty-agents/#2-the-bead-that-never-stops-failing),
so attempts get capped and structural failures get routed to a human instead
of back into the queue.

**The team topology stays flat.** The documented limitations draw the
ceiling precisely: one team per session, no nested teams (teammates cannot
spawn their own teammates), and a fixed lead that cannot be promoted or
transferred. In-process teammates can use foreground subagents, but cannot launch
background subagents that outlive the lead. For 3–5 teammates that ceiling is invisible. At twenty workers
you are not running a big team — you are running a queue, with teams or
sessions as the workers, which is the [cattle-not-pets
argument](/notes/agents-pets-cattle/) in one sentence. The
[when-orchestration-becomes-necessary
section](/guides/agent-orchestration/#when-orchestration-becomes-necessary) of
the hub guide marks the same boundary from the other side: unattended
continuation is the threshold where task state has to move out of any session
entirely.


<div data-agent-teams-exhibit="fleet">

**Attempts are not deliveries.** These are my unattended fleet's observed
outcomes over the 49-day trace period beginning September 12 and ending
October 31, 2026. Attribution follows the adapter that actually ran the
attempt, rather than the worker's name. Yield is verified attempts divided
by all attempts, including attempts that split a task into smaller work.

| Harness | Attempts | Verified | Yield |
| --- | ---: | ---: | ---: |
| Codex CLI | 9,708 | 4,843 | 49.9% |
| Claude Code / Anthropic | 91 | 20 | 22.0% |
| Claude Code / GLM (Z.AI) | 8,302 | 3,303 | 39.8% |

The workloads and sample sizes differ. This is an operational observation,
not a controlled model comparison or an agent-teams benchmark. A verified
attempt is an outcome recorded by the fleet's gate; it is not a count of
unique tasks. The larger [coding-harness study](/guides/codex-vs-claude-code/)
explains the surrounding telemetry.

</div>

## How do you verify a teammate's work?

The documented enforcement points, in one table:

| Hook | Fires when | Exit code 2 does |
| --- | --- | --- |
| `TaskCompleted` | A task is being marked complete | Blocks the completion and sends feedback |
| `TaskCreated` | A task is being created | Blocks the creation and sends feedback |
| `TeammateIdle` | A teammate is about to go idle | Sends feedback and keeps the teammate working |

**Task hooks need tasks to act on.** Without Task tools, `TaskCreated` does
not fire; a message-only team is not a substitute completion gate.
`TaskCompleted` also runs when a teammate ends its turn with in-progress
tasks, so exercise the hook against your actual workflow. Test its failure
path too: with blank stdout, an exit-2 error containing `No such file` or
`can't open` is treated as a missing script and does not block completion
or idle. A hook that could not run needs a separate artifact check. See the
[hook reference](https://code.claude.com/docs/en/hooks/#taskcompleted).

Plan mode adds a second gate: a teammate spawned while the lead is in plan
mode works read-only until its plan is ready, and the plan approval is
auto-approved only if you have not changed that teammate's permission mode
since spawn — otherwise the lead reviews it.

The permission model underneath is the part I'd underline. Teammates start
with the lead's permission mode (except `dontAsk`, which they do not inherit),
and `--dangerously-skip-permissions` propagates to all of them. An in-process
teammate outside plan mode follows the lead's live `acceptEdits`, `auto`, or
`bypassPermissions` mode even if its own status bar says Manual; switch the
lead to Manual too if you need prompts. Permission prompts bubble to the lead.
Split-pane teammates inherit `--tools` and `--disallowedTools` from the lead
on current releases, but **not `--allowedTools`**. Put session-wide allow rules
in `permissions.allow` through `--settings` when you need them to apply there. And the docs state the trust boundary explicitly:
a teammate cannot approve a permission prompt or supply consent on your behalf,
a denied action cannot be relayed to another teammate to bypass the check, and
in auto mode the classifier treats an approval claim relayed from another agent
as *untrusted input*. That last rule is word-for-word the lesson of
[env-var isolation is not a
defense](/notes/ignore-env-is-not-a-defense/) and [trust is a property of the
system](/notes/trust-is-a-property-of-the-system/): instructions between
agents are traffic, not authority.

Then the gap the docs concede themselves: "task status can lag." A checkbox is
a claim about the artifact, and the claim can be wrong in both directions —
done-but-unmarked (which blocks dependents) and marked-but-broken (which ships
regressions). So verification has to run against the artifact, not the status
field. My operating rules, each earned the expensive way:

- **Nobody grades their own homework** — [the original
  lesson](/notes/dont-let-the-agent-grade-its-own-homework/). Put the real
  check in the `TaskCompleted` hook, or run it after the team reports done.
  The teammate's "completed" is the trigger for verification, never the
  verdict.
- **A gate that could not run is not a gate that passed.** The
  [verification section of the hub
  guide](/guides/agent-orchestration/#isolation-secrets-and-verification)
  covers why I classify "check didn't execute" as its own outcome. An exit
  code you never saw is not a zero.
- **Read the diff, not the summary.** A teammate's idle notification includes
  its final answer — which is a summary. Summaries are for routing attention;
  verification reads what changed.

## What does an agent team cost?

The docs name the cost model plainly: agent teams use significantly more
tokens than a single session, and token usage scales with the number of active
teammates, because each has its own context window. Two documented details
matter more than the headline:

- An in-process teammate's requests fall **outside the main conversation's
  cache TTL bucket**, so its prompt cache holds for five minutes by default.
  `subagentPromptCacheTtl` can extend that to an hour, and the docs note the
  one-hour cache writes bill at a higher rate.
- The docs' own break-even: the extra tokens can be worthwhile for
  research, review, and new feature work ; routine tasks favor one session.

The fleet lens replaces "tokens" with a different unit: [cost per *verified*
completed task](/notes/unit-economics-of-cattle/). Token totals alone hide
whether the fleet delivered anything. A low token bill with zero verified
results does not establish good economics. An idle worker does not necessarily
make API requests, but later resumption can lose a warm cache; active
coordination can spend tokens without delivering an artifact. The
docs' starting advice of 3–5 teammates matches what I run into constantly:
beyond a handful, coordination overhead and diminishing returns eat the
parallelism for discussion-shaped work. Twenty only makes sense with the
machinery from the second half of this guide — durable task state, capped
retries, independent verification — and with spend measured against [verified
completed tasks](/guides/agent-orchestration/#budgets-and-observability), not
panel activity.


<div data-agent-teams-exhibit="subagents">

**A short returned answer can hide a large delegation bill.** My Claude Code
transcript study through October 31, 2026 found the following in subagent
sidechain transcripts. All tokens includes uncached input, cache creation,
cache reads, and output; output is generated tokens, not verified code.

| Measure | Observed value |
| --- | ---: |
| All tokens in sidechains | 7.7% |
| Output tokens in sidechains | 1.0% |
| Subagent files | 4,567 |
| Parent sessions | 2,452 |
| Median total tokens / sidechain | 384,492 |
| Median output tokens / sidechain | 348 |

These are subagents across my mixed interactive and headless workload,
including different model providers. They are not teammate measurements,
a quality score, or a predicted multiplier for your next team. They show
why I inspect the whole token mix before inferring cost from the answer's
length. Background and method: [the coding-harness study](/guides/codex-vs-claude-code/).

</div>

## When should you not use agent teams?

Take the docs' boundary first, because it is correct: sequential tasks,
same-file edits, and dependency-heavy work fit a single session or subagents
better. Two teammates editing the same file leads to overwrites — the docs'
best-practices section says so in one line. That line deserves amplification,
because it is not a product limitation; it is a decomposition rule. [Decomposition
is concurrency control](/guides/workflow/#s06-decomposition-is-concurrency-control):
if two workers' tasks touch the same function, no claim protocol will save
you — the tasks were cut wrong.

My additions, from the other side of the docs' boundary:

- **Strictly ordered pipelines.** Dependency edges guide self-claiming, but
  explicit assignment can still select a blocked task. A step-by-step pipeline
  gains nothing from a team. Use one session with a plan.
- **Anything you cannot afford to re-verify.** Until a real gate exists in
  `TaskCompleted` (or after the team), a team of five is five sources of
  plausible-sounding completion claims.
- **Headless automation.** Per the docs, teammates only spawn in interactive
  sessions. Unattended multi-agent work is a queue-and-worker architecture —
  which is the [hub guide's](/guides/agent-orchestration/) whole subject — not
  a very large team.

A useful framing before adopting any of this: the same four requirements from
[choosing a control tool](/guides/agent-orchestration/#choosing-a-control-tool)
— durable task state, exclusive claims, an explicit failure handler, and
independent verification. Agent teams supply session-scoped task state and file-locked claims
when the Task tools are available, plus hooks and plan approval mechanisms.
The task directory surviving on disk does not restore a team after `/resume`,
and a plan can be auto-approved; neither is independent artifact verification. The verification — and the budget that bounds it — is still yours.


<div data-agent-teams-exhibit="chooser">

**Team or fleet? Choose the coordination boundary first.** This is my
operating heuristic, not an Anthropic guarantee or a performance estimate.

| Work shape | Starting choice |
| --- | --- |
| Headless, unattended, or work must outlive this session | Durable queue and workers; keep ownership, retries, and verification outside any single conversation. |
| Interactive and session-bounded, but ordered or overlapping | One session; sequence the edits before adding concurrency. |
| Interactive, independent tasks with findings to return | Subagents; give each a bounded deliverable. |
| Interactive, independent tasks needing peer discussion | Agent team; start small and reconcile the result. |

</div>

## How do you finish and shut down a team?

Give the lead a concrete finish line: each reviewer returns findings with
evidence, the lead reconciles disagreements, and the final artifact passes
the checks you chose before launch. Then ask the lead to shut down named
teammates. A teammate can accept or reject the shutdown request; a running
request or tool call can delay its exit.

There is no separate team-cleanup command in the current documentation.
Claude Code removes the session's team-config directory automatically when
the session ends. The task directory stays on disk subject to
`cleanupPeriodDays`. Those files are useful records, but they do not restore
in-process teammates after `/resume`.

The question I now ask is simple: **will someone be present to reconcile the
result?** If yes, a small team can be a useful thinking tool. If no, I need
an owner, durable task state, bounded retries, and an independent gate before
I add more workers.

## Versions and sources

**Versions used** (so the next refresh is mechanical):

- Claude Code agent teams documentation —
  [code.claude.com/docs/en/agent-teams](https://code.claude.com/docs/en/agent-teams/)
  — accessed **2026-11-30**. Installed CLI: **2.1.332**. This is a
  documentation review, not a live team benchmark. The feature remains
  experimental and interactive-only for teammate spawning.
- [Hooks reference](https://code.claude.com/docs/en/hooks/) and
  [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging/)
  — accessed **2026-11-30**. Hook gates apply only when the hook actually runs;
  messaging retains the receiving session's permission boundaries.
- Split-pane display mode requires tmux, or iTerm2 with the `it2` CLI and the
  iTerm2 Python API enabled.
- Fleet-scale claims in the second half are summarized from my own operation
  of about twenty concurrent headless agents; the incidents are written up
  with causes and rules in [what breaks when you run twenty agents at
  once](/notes/what-breaks-at-twenty-agents/), and the surrounding
  architecture — queues, claims, verification gates, budgets — in [agent
  orchestration in production](/guides/agent-orchestration/).

Related reading in this series and nearby: [the workflow
manual](/guides/workflow/) for the full human-driven loop this fleet grew out
of, [credential boundaries](/notes/ignore-env-is-not-a-defense/) and
[independent verification](/notes/dont-let-the-agent-grade-its-own-homework/)
for the trust model, and [cost per closed
task](/notes/unit-economics-of-cattle/) for the economics.