What this unit solvesSubagents are one-shot executors: they are spawned, finish a task, return a result, and their context does not persist. Agent Teams are addressable, continuously running, collaborative agents: once created they retain an identity, can receive messages, exchange state with other agents, and pick up tasks. This unit clarifies the lifecycle differences between the two mechanisms, how each is enabled, and covers three collaboration patterns — orchestrator-worker, parallel independent work, and peer messaging — so you can choose the right tool and avoid over-engineering your automation flows.
Learning objectives
After completing this unit you should be able to:- Distinguish the fundamental difference between a Subagent (one-shot spawn, result returned to the caller, context does not persist) and Agent Teams (addressable, continuously alive, collaborative).
- Describe how each is enabled and its current limitations (as of 2026-06, Agent Teams is an experimental feature).
- Name the three collaboration patterns (orchestrator-worker, parallel independent work, peer messaging) and identify the scenario each fits.
- Decide whether a given task calls for a Subagent, Agent Teams, or no multi-agent architecture at all.
1. Definitions and core differences
Anthropic introduced Agent Teams starting with Claude Code v2.1.32 [1]. It is a separate multi-agent layer from 04-5 Subagents: instead of “spawn, run to completion, disappear,” it means “multiple Claude Code instances organized as a team, sharing a task list, messaging each other, addressable by both the user and the lead.”Naming clarificationThis unit uses Subagent for the mechanism described in 04-5 (one-shot, isolated context, returns a result), and Agent Teams for the “agent teams” / teammate concept in Anthropic’s documentation (persistent, addressable, collaborative). Subagents and Agent Teams are independent mechanisms that can coexist: a single session can have both simultaneously, each playing a different role.
| Dimension | Subagent | Agent Teams |
|---|---|---|
| Lifecycle | Terminated when the task ends | Persists until the lead dissolves the team |
| Addressability | Not addressable (caller initiates spawn) | Addressable by lead, other teammates, and the user |
| Context | Fresh context on every spawn | Persists across turns (each teammate accumulates its own context) |
| Communication | Returns result to caller only | Bidirectional messaging via mailbox, shared task list, idle notification |
| Concurrency limit | Multiple spawns allowed within the same session | One lead manages one team at a time [1] |
| Nesting | Cannot spawn subagents | Teammates cannot spawn a team or other teammates [1] |
| Token cost | Lower (only the summary result returns to the caller) | Higher (each teammate holds a full context window) |
| Ideal for | One-shot subtasks, read-only queries, parallel work where results do not need to interact | Sustained collaboration, multi-round feedback, shared state, user intervention during the run |
2. How to enable each
2.1 Subagents (04-5 covers this in full)
Invoke explicitly from a session or a skill withAgent(<name>), or let Claude auto-delegate based on the description field. Subagent definitions live in .claude/agents/, the user-level ~/.claude/agents/, a plugin’s agents/ directory, managed settings, or the --agents CLI flag. The lifecycle is exactly: spawn, run the task, return the result, terminate.
2.2 Agent Teams
As of 2026-06, Agent Teams is an experimental feature, disabled by default [1]. To enable:2.3 Display modes
Agent Teams supports two display modes [1]:| Mode | Setting | Behavior |
|---|---|---|
| in-process (default fallback) | teammateMode: "in-process" | All teammates run within the main terminal. Shift+Down cycles between them; you can send messages directly to any teammate. |
| split-pane | teammateMode: "tmux" | Each teammate gets its own pane. Requires tmux or iTerm2 + the it2 CLI. |
auto: uses split-pane when launched inside a tmux session, otherwise falls back to in-process. To force a mode:
Split-pane on Windows: psmux or WSL tmuxNeither tmux nor iTerm2 is Windows-native, so Windows users will land on in-process by default. Two paths exist for split-pane on Windows:
- psmux: a Rust-based native Windows terminal multiplexer, compatible with existing
.tmux.conf, no WSL or Cygwin required. Launch Claude Code inside a psmux session and teammates automatically open in separate panes. As of 2026-06 this is still a new project (version 0.1.x); evaluate its maintenance status before adopting it [4]. - WSL tmux: install tmux inside WSL and run Claude Code from a WSL terminal. Split-pane behaves identically to native tmux, provided your project and toolchain are accessible on the WSL side.
2.4 Model selection
Teammates do not inherit the lead’s/model setting by default. To set a default teammate model: run /config inside Claude Code and select Default teammate model. Choosing “Default (leader’s model)” makes all teammates use the same model as the lead [1].
3. Collaboration patterns
3.1 Orchestrator-worker
A lead agent breaks down a task, then spawns multiple Subagents in sequence or in parallel, collects each result, and integrates them. Subagents are unaware of each other’s existence.3.2 Parallel independent work
Multiple Subagents process non-overlapping subtasks simultaneously (each operating on different files or modules); the main thread merges results at the end. The most common multi-agent pattern and the simplest to implement. Agent Teams can do this too, but adds unnecessary complexity. The criterion: workers do not need to communicate and results can be merged — Subagents are enough.3.3 Peer messaging
Agent Teams communicate via mailbox, negotiating state across messages. Suited for workflows that require multiple rounds of feedback:- A reviewer sends comments back to a writer; the writer revises and sends back to the reviewer.
- Multiple investigators each propose a hypothesis, challenge each other’s reasoning, and converge on a conclusion.
- Multiple parallel exploration threads are finally integrated by the lead into a single synthesis.
Pattern selection examplesScenario 1: code review
Three reviewers (security / performance / test coverage) each examine the same PR and return results. → Subagents are enough (results merge; no dialogue needed).Scenario 2: evaluating an open-source project
A research-owner agent sends three Subagents to examine “code quality,” “community health,” and “licensing and maintenance.” Three results merge into a single recommendation. → Subagents are enough.Scenario 3: bug investigation with unknown root cause
Spawn 5 teammates, each proposing one hypothesis, each challenging the others, each leaving behind evidence that survived the challenge. → Agent Teams add value (requires message exchange and a debate structure).Scenario 4: writer + reviewer iterating on a document draft
Writer drafts, reviewer comments, writer revises, reviewer reviews again, multiple rounds until convergence. → Agent Teams (a Subagent dies after one round and cannot hold a multi-turn conversation).
4. Independent operation
4.1 When to let agents avoid each other
Subtasks with no shared mutable state (each reads different data, writes different files) → parallel independent work is the simplest and requires no synchronization mechanism. Implementation: each Subagent / teammate works in a separate worktree. Git worktrees are the physical isolation tool (see 04-5):4.2 When shared state is unavoidable
Task B’s input depends on Task A’s output → use sequential orchestration (B starts only after A finishes) or Agent Teams peer messaging; do not use parallel execution. Parallel work is especially fragile when dependencies exist: if A and B are both instructed to “read the same file and modify different sections,” the final merge will conflict. Map out dependencies first: if two tasks share mutable state, run them sequentially or let Agent Teams coordinate the exchange.4.3 Strengthen the workflow with TeammateIdle / TaskCreated / TaskCompleted hooks
Agent Teams exposes three dedicated hook event points [1, see 04-6 Hooks]:TeammateIdle: teammate is about to enter idle. Returnexit 2to give feedback and keep it working.TaskCreated: a task is being created. Returnexit 2to block creation.TaskCompleted: a task is being marked complete. Returnexit 2to reject completion and give feedback.
TeammateIdle. Teammate marks a task complete but the commit message doesn’t follow team conventions? Reject with TaskCompleted.
5. Cost and complexity
5.1 When not to parallelize
Parallel execution adds extra context cost and coordination complexity. If subtasks depend on each other, or if integrating results costs more than the decomposition saves, run sequentially. Three cost-evaluation questions:- Are the subtasks truly orthogonal? Shared input, cross-reads and cross-writes, shared mutable state → not orthogonal; parallel execution will actually be slower.
- Is integrating the results manageable? If three results contradict each other and require extensive secondary coordination → the gains from decomposition disappear.
- Does the speedup from parallelism offset the extra token cost? 5 Haiku workers vs 1 Sonnet run end-to-end: 5 workers burn 5x context; 5x speedup is the theoretical ceiling. Real-world speedup is often only 2-3x (due to communication overhead, synchronization, and idle time).
5.2 Model selection
Worker agents should use the cheapest model available (Haiku); only the main orchestrator or lead needs Sonnet or Opus reasoning capability (see 04-5). Agent Teams does not inherit the lead’s model by default ([1] section 2.4); explicit assignment is required to control costs:/config to set the default teammate model to a Haiku-class model.
5.3 Known limitations
Agent Teams is an experimental feature. Officially documented limitations [1]:- In in-process mode, resume does not restore teammates.
- Task status can lag.
- Shutdown can be slow (teammates finish their current tool call before stopping).
- One lead can manage only one team.
- No nesting.
- Lead is fixed and cannot be transferred.
- Permission mode is decided at spawn time; it cannot be changed after the team starts.
- Split-pane mode requires tmux or iTerm2.
6. Tool comparison
| Concept | Anthropic Claude (primary) | OpenAI | GitHub Copilot | Cursor (brief) | |
|---|---|---|---|---|---|
| One-shot sub-agent | Subagent (Agent(<name>) tool) [04-5] | Configuration-based [needs source verification] | Configuration-based [needs source verification] | Configuration-based [needs source verification] | Configuration-based [needs source verification] |
| Persistent / addressable agent | Agent Teams (v2.1.32+, experimental) [1] | Swarm / Assistants (similar concept) [needs source verification] | Configuration-based [needs source verification] | Configuration-based [needs source verification] | Configuration-based [needs source verification] |
| Shared task list | Yes (~/.claude/tasks/<team>/) [1] | Configuration-based | Configuration-based | Configuration-based | Configuration-based |
| Inter-agent messaging | Yes (mailbox + SendMessage) [1] | Configuration-based | Configuration-based | Configuration-based | Configuration-based |
| Teammate hook events | TeammateIdle, TaskCreated, TaskCompleted [1, 04-6] | N/A | N/A | N/A | N/A |
| Display modes | in-process / split-pane (tmux / iTerm2) [1] | Configuration-based | Configuration-based | Configuration-based | Configuration-based |
| Physical isolation | isolation: worktree ([04-5]) | Environment layer | Environment layer | Environment layer | Environment layer |
Naming and boundaries
- Agent Teams (v2.1.32+) is an experimental feature, disabled by default; enabled with
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1[1]. - For OpenAI, GitHub Copilot, and Cursor, the specific multi-agent mechanisms follow each vendor’s current official documentation; entries marked “needs source verification” should be confirmed.
- Cursor is a third-party IDE (Anysphere); this Playbook only covers it briefly in one column.
Hands-on exercises
Run each of the three patterns once (20 minutes)
Orchestrator-worker (Subagent): in your current project, use three Subagents in parallel to review from security, performance, and test-coverage angles. Observe the cost of integrating three results in the main thread.Parallel independent work (Subagent): have three Subagents each refactor a different module. Observe whether worktree isolation turns out to be necessary.Peer messaging (Agent Teams — first enable
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1): build a team of 3 teammates and have them each propose a hypothesis about an unfamiliar bug, then challenge each other. Observe whether token cost is noticeably higher than the Subagent patterns above.Common pitfalls
Self-check
The bar for passing this unit
- Can you produce a table showing how Subagents and Agent Teams differ across lifecycle, addressability, communication mechanism, and token cost?
- Can you decide which mechanism fits each of these three tasks?
- Refactoring three independent modules
- Generating multiple competing hypotheses about an unknown bug
- Adding a feature that spans 5 files (5 self-contained subtasks)
- In your most recent multi-agent design, were the subtasks genuinely orthogonal — or did they just feel like they should be parallel?
- Does your
CLAUDE.mdstate explicit criteria for “which tasks go to a Subagent” vs “which go to Agent Teams”?
Sources and further reading
Factual claims are grounded in official documentation; fast-changing items are annotated as of 2026-05.-
[1] Anthropic, “Orchestrate teams of Claude Code sessions,” code.claude.com, 2026. [Online]. Available: https://code.claude.com/docs/en/agent-teams (as of 2026-06; v2.1.32+ enablement,
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, mailbox, shared task list, teammate hook events, display modes, known limitations) -
[2] Anthropic, “Create custom subagents,” code.claude.com, 2026. [Online]. Available: https://code.claude.com/docs/en/sub-agents (as of 2026-06; full subagent frontmatter,
isolation: worktree,skillspreloading,Taskrenamed toAgentin v2.1.63) -
[3] Anthropic, “Hooks,” code.claude.com, 2026. [Online]. Available: https://code.claude.com/docs/en/hooks (as of 2026-06; TeammateIdle, TaskCreated, TaskCompleted events,
exit 2interception semantics) -
[4] psmux, “psmux: native terminal multiplexer for Windows,” GitHub, 2026. [Online]. Available: https://github.com/psmux/psmux (as of 2026-06; Rust single binary, compatible with
.tmux.conf, Windows-native, no WSL or Cygwin required; teammates automatically open in separate panes when Claude Code is launched inside a psmux session; version 0.1.x, a new project)
- Subagent design and
isolation: worktree: 04-5 Subagents. - Combining Skills with Subagents: 04-4 Skills.
- Cross-agent integration interfaces: 04-9 MCP Integration.
- Enforcement via hooks: 04-6 Hooks.
- Context isolation concepts: 01-4 Context Engineering.
- Multi-step task orchestration: 01-5 Workflow Engineering.