Agent Teams & Communication
Coordinate a lead and independent teammates through a shared task list and mailbox.
What You’ll Learn
Agent Teams are Claude Code’s experimental mode for sustained collaboration among multiple independent sessions. This session focuses on the public operating model:
- one lead coordinates the team;
- teammates work in separate context windows;
- a shared task list tracks ownership and dependencies;
- a mailbox carries direct messages between agents.
Agent Teams are experimental and disabled by default. The workflow below is verified against the official documentation on October 21, 2026 (Claude Code 2.1.305).
The Public Team Model
| Component | Responsibility |
|---|---|
| Team lead | Spawns teammates, coordinates work, assigns tasks, and synthesizes the result |
| Teammates | Independent Claude Code sessions that investigate or implement bounded work |
| Shared task list | Holds pending, in-progress, and completed tasks, including dependencies |
| Mailbox | Delivers messages between the lead and teammates, or directly between teammates |
A teammate receives the project context it would normally load, such as CLAUDE.md, skills, and MCP servers, plus its spawn prompt. It does not inherit the lead’s conversation history. Put every task-specific fact needed for success in the spawn prompt or a message.
A teammate runs on the model your spawn prompt names; otherwise Claude Code uses its subagent definition’s model, then CLAUDE_CODE_SUBAGENT_MODEL, then the lead’s current model (this order applies since Claude Code 2.1.251). The old teammateDefaultModel setting was removed in Claude Code 2.1.234, so name the model in the prompt when it matters.
Agent Teams vs. Subagents
Use a subagent when a focused worker can return one result to its caller. Use an Agent Team when workers need to exchange findings, challenge one another, claim work, or stay independently addressable.
| Subagent | Agent Team teammate | |
|---|---|---|
| Context | Own context window; the result returns to the caller | Own context window; a fully independent session |
| Communication | Returns a result to the caller; subagents Claude named can also message each other | Teammates message the lead and each other directly |
| Coordination | Main agent manages the work | Messages, plus a shared task list when the agents have the Task tools |
| Cost | Lower | Higher; every teammate is a separate Claude instance with its own context |
Before you form a team, check whether a lighter option is enough: a subagent, or cross-session messaging between sessions you run yourself.
Enable Agent Teams
Set the experimental flag in your environment or settings. On current models, also opt in to the Task tools: without them there is no shared task list, and agents coordinate through messages only (see Session 7).
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
"CLAUDE_CODE_ENABLE_TODO_TOOLS": "1"
}
}
Teams need an interactive session. In -p runs and Agent SDK sessions, Claude doesn’t spawn teammates. Enabling the flag also changes ordinary delegation: while it is on, a subagent that Claude spawns with a name launches as a teammate, so a team can form even when you didn’t ask for one.
Then describe the team and its boundaries in natural language:
Create an agent team with three teammates:
- researcher: map the current authentication flow
- reviewer: look for security and permission risks
- tester: identify missing tests
Give each teammate a separate task. Ask them to share evidence with one another,
then wait for all tasks to finish before synthesizing the result.
With the flag set, every session has one implicit team, and the session you start is its lead (Claude Code 2.1.178 and later). Claude launches a teammate by calling the Agent tool with a name; there is no public TeamCreate or TeamDelete tool to script around. If Claude used plain subagents instead, ask again and explicitly request an agent team.
Coordinate Through Tasks and Messages
The lead can assign a task explicitly, while a teammate that finishes its work can claim the next unassigned, unblocked task. Dependencies keep work pending until prerequisites are complete, and Claude Code unblocks dependent tasks automatically when the task they wait on is completed. Agents without the Task tools skip the task list and coordinate through messages.
Use messages for information that changes another agent’s work:
Tell reviewer that researcher found token parsing in src/auth/token.ts.
Ask tester to validate the same boundary and report the failing command.
Messages are delivered automatically; the lead doesn’t poll. Each message goes to one named recipient, so reaching everyone means one message per teammate. When a teammate finishes and goes idle, it notifies the lead and includes its final answer. The task list records work state; it is not a substitute for explaining acceptance criteria, file ownership, or evidence.
A Reliable Operating Pattern
- Split work into independent deliverables with distinct file ownership.
- Give each teammate the relevant paths, constraints, and definition of done.
- Put dependencies in the shared task list instead of relying on timing.
- Ask teammates to send evidence, not only conclusions.
- Wait for all active work to finish, then have the lead reconcile conflicts and verify the combined result.
Start with three to five teammates only when parallelism is worth the coordination and token cost. Sequential work, tightly coupled tasks, and same-file edits are usually better handled in one session.
Lifecycle and Limits
- In the default in-process display, select a teammate in the agent panel below the prompt and press Enter to view and message it;
xstops the selected teammate andCtrl+Ttoggles the task list. Split panes (tmux or iTerm2) are opt-in through theteammateModesetting. - Teammates start with the lead’s permission mode (except
dontAsk), and their permission prompts appear in the lead session. One agent cannot approve a prompt on your behalf or relay a denied action to another agent. - Ask the lead to shut a teammate down when its work is finished; the teammate can accept, or reject with an explanation.
- Claude Code removes the team’s runtime config when the session ends. The task list directory stays on disk until the normal
cleanupPeriodDayscleanup. Don’t edit or pre-author these files. - Documented limitations:
/resumeand/rewinddon’t restore in-process teammates, task status can lag, shutdown can be slow, there is one team per session, teammates cannot spawn teammates of their own, and the lead can’t be changed.
The durable contract is the behavior above: lead, teammates, shared tasks, and messaging. The official reference documents where team and task files live, but describes them as runtime state that Claude Code overwrites. Build on the behavior, not on the files.
Official Sources
- Orchestrate teams of Claude Code sessions
- Create custom subagents
- Tools reference: Task tool availability
Next Session
Next, turn collaboration into an explicit protocol: ownership, evidence, handoff, and completion rules.