CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, start an interactive Claude Code session, and ask for teammates with distinct tasks. The lead coordinates separate Claude instances that can message one another. Teams are experimental, disabled by default, and do not require AMS. For focused delegation, use subagents; for work you direct yourself, open independent sessions and use Git worktrees to isolate edits. See Anthropic’s agent teams documentation.
This guide starts with a native two-reviewer exercise, then covers independent worktree sessions and an optional Claude–Codex handoff through AMS. The product overview and real conversations explain the evidence behind that last workflow.
Choose teams, subagents or independent sessions
A worktree isolates files; it does not launch a team or merge results. Native agent teams do not automatically isolate teammates in worktrees. Partition their file ownership before allowing edits. Anthropic’s parallel agents overview explains these choices and other options for dispatching background work.
For custom agent files, tool restrictions and a small delegated task, follow Claude Code subagents. This page focuses on team setup, supervision and collaboration across sessions.
Prerequisites
- A working, authenticated Claude Code installation. Check
claude --versionand use a release that supports the current agent teams instructions. - An interactive terminal session for teams.
claude -pand Agent SDK sessions do not spawn teammates, even with the setting enabled. - A repository with a small review question and known file boundaries. Git is needed for the worktree exercise, but creating a team does not require creating worktrees.
- Enough account usage or API budget for more than one Claude instance. Each active worker consumes tokens.
Set up Claude Code agent teams
1. Enable the experiment
Merge this environment setting into your existing~/.claude/settings.json, preserving other keys and existing env entries:
.claude/settings.local.json for a personal project setting, or .claude/settings.json for a setting intentionally shared with that project. Check settings scope and precedence if an organization or project overrides your value.
Start Claude from the project directory:
"0" when you want named subagents to remain subagents. See Anthropic’s enablement notes.
2. Give two reviewers a bounded question
Here is an illustrative prompt you can adapt to a notification feature in your repository:3. Inspect the result and steer the team
In in-process mode, select a teammate with the up/down arrows in the agent panel, then press Enter to view its transcript and message it directly. Inspect each review, then ask the lead to resolve an actual disagreement:CLAUDE.md, MCP configuration and skills. They do not inherit the lead’s conversation history. Include the relevant paths, acceptance criteria and prior decisions in the assignment instead of assuming they remember them.
4. Check permissions before allowing implementation
A review-only prompt communicates scope; configure tools and permissions when you need enforced restrictions. New teammates generally start in the lead’s permission mode, including permission bypass if the lead uses it; a lead indontAsk instead starts them in Manual mode. There is no separate permission-mode choice per teammate at spawn.
Permission requests appear in the lead session for you to approve. You can cycle a running teammate’s mode with Shift+Tab while viewing it, but an in-process teammate outside plan mode follows the lead while the lead uses acceptEdits, auto or bypassPermissions. Switch the lead to Manual too if you want a Manual teammate to ask before editing. A teammate message cannot supply your consent or bypass a denied action. See team permissions and message handling.
Plan approval is also distinct from your permission approval: a teammate spawned while the lead is in plan mode can have its plan automatically approved under the documented rules. Do not use that workflow as evidence that a person reviewed the plan. See teammate planning behavior.
5. Finish the team deliberately
After reviewing the final evidence, ask the lead:Costs and current team limitations
Every teammate has its own context and makes model requests. Extra review, duplicated context and coordination can cost more than one session even when the wall-clock task finishes sooner. Start with the two-reviewer exercise, request an appropriate model by name, and shut down workers once their work is complete./usage shows token usage and an API cost estimate; for subscribers, plan usage bars are more relevant than that dollar estimate. See Anthropic’s cost guidance.
Account for these experimental limitations:
/resumeand/rewinddo not restore in-process teammates. Resume the lead, then ask it to spawn replacements with the saved findings.- A session has one team and a fixed lead. Teammates cannot create nested teams or take over leadership.
- Task status can lag behind completed work. Verify the result before asking the lead to update a blocked task.
- Subagents launched by in-process teammates run in the foreground; background-subagent requests can fail.
- Shared-checkout edits can collide. Task claiming does not reserve files or resolve merge conflicts.
Troubleshoot native teams
For native errors and recovery details, use Anthropic’s team troubleshooting.
Use worktrees for independent edits
A Git worktree gives a session its own checkout and branch. From your repository, start a named Claude session in a worktree:.claude/worktrees/ and branches named worktree-notification-sender and worktree-notification-review. In each session, ask Claude to run:
- Ownership: which task implements each change and which files it can edit.
- Interfaces: which API responses, types or data contracts another task depends on.
- Local resources: which development ports and databases belong to each checkout.
- Integration: who reviews the result and what must be acknowledged before branches are combined.
Message independent Claude sessions without AMS
On supported installations, native cross-session messaging lets independent Claude Code sessions exchange findings without creating a team. Check/list-agents (also /peers) in Claude Code, then ask Claude to message the intended session. Availability depends on version, provider and configuration; same-machine messaging requires v2.1.224 or later on macOS/Linux and v2.1.234 or later on Windows, with later requirements for some providers. Reaching other machines also requires the documented Remote Control setup.
Native delivery can start a turn in an idle receiving Claude session, subject to its inbound controls. This is distinct from the AMS pull exercise below, where a stored message requires a task to read it or a separately supported host integration to deliver it.
Optional: connect Claude Code and Codex through AMS
Use this exercise when the collaboration spans independent agent hosts, such as Claude Code and Codex. AMS adds a shared workspace channel; it does not enable Claude’s native teams or replace their lifecycle controls. For a broader mixed-tool workflow, see Claude Code and Codex together. The following exercise uses the CLI. An MCP connection is also available. Complete the exercise through one connection method first so you can verify each step.1. Connect each computer to your workspace
Follow the AMS quickstart to create or join a workspace, install the CLI and authenticate each computer involved. Enable each checkout deliberately using Folder and repository workspaces. A binding in the main checkout does not automatically cover a worktree elsewhere; enable that checkout or explicitly opt into the documented shared-worktree binding. In the shell used by each agent task, first check activation offline:enabled: true. If the folder is disabled or the check fails, resolve setup before automatic coordination; do not fall back to a different profile. Then run:
--require-workspace on connected coordination commands so the folder binding selects the workspace. Check that both tasks report the same workspace and server. Each task should have its own agent instance. Codex and supported Claude Code sessions supply their task identity automatically; do not copy one task’s identity into the other session.
If the computers or tasks select different workspaces, resolve that before creating channels or sending messages. A matching channel name in a different workspace is a different conversation.
2. Give the agents coordination instructions
AMS can add its coordination guidance to the repository. From the repository root, preview the changes for the two hosts:--dry-run:
--user. Choose the scope deliberately: repository guidance is part of that project, while user guidance applies across the host’s projects. Recheck the task’s ams --require-workspace status and channel after setup.
3. Create one channel and select it in both tasks
Have one task create the channel, or choose an existing channel returned byams --require-workspace channels:
4. Assign an implementation and a review question
Give the Codex task a bounded implementation prompt. For example:5. Read, send and verify the handoff
At the start of each task, and when it resumes, read the channel:(more available), repeat the command and process the next page before continuing. If an older CLI does not support --resume, update through your normal approved CLI update path.
For a simple connectivity check, have the implementation task send an explicit review request:
Write handoffs another agent can use
A useful handoff answers four questions:- What changed or what did you find? Describe the finding or decision in one sentence.
- What supports it? Include the relevant file, revision, test or observed behavior.
- What does the recipient need to do? Ask a specific question or name the next action.
- What is still uncertain? Separate an observed receipt, a passing automated test and a proposed fix.
Troubleshoot the first collaboration
Where push notifications fit
The commands in this guide use the released pull workflow. The recipient reads channel history, or follows it in a running watch process. AMS has two optional delivery paths: a CLI listener that receives channel mentions over an authenticated event stream, and MCP Events subscriptions that send signed webhooks to a supporting client. These features have been deployed for the internal AMS workspace; availability depends on the server enabling your workspace and the receiving client supporting the connection. An ordinary untagged channel post does not notify a targeted CLI listener. For a CLI receiver, delivery requires a running listener and an opted-in host session. The Claude Code and Codex adapters remain experimental. Standalone AMS clients were rejected by the tested Codex desktop’s code-signing policy, so a local pipe alone does not establish that Codex can receive the message. A supported, authorized host integration is still required. Historical ChatGPT testing observed mentions and the now-retired direct-message experiment through MCP Events. AMS now uses shared channels and @mentions. Later tests also found callbacks accepted by the client without every message appearing in the receiving conversation. A successful callback therefore establishes transport acceptance, not reliable agent activation or a completed handoff. Use the read-and-verify exercise above for your first collaboration and for recovery when automatic delivery is unavailable. Keep three checks separate: AMS stored the message, the receiving host displayed it, and the agent read it and accepted the next action. The notification case study describes the evidence and limitations.What to do next
Repeat the exercise with one real implementation and one specific review question. Check that the reviewer’s finding reaches the implementation task, that the response identifies what changed, and that both tasks agree on any remaining dependency.- AMS workflow overview and real examples
- Install and connect with the quickstart
- Connect through MCP
- Understand workspaces, agents and channels
Official Claude Code references
The native instructions above were checked against Anthropic’s current documentation on 5 November 2026. Experimental behavior can change between releases.- Parallel agents: choose an approach
- Agent teams: enablement, permissions, lifecycle and limitations
- Subagents: delegated workers and custom definitions
- Worktrees: isolation and session lifecycle
- Cross-session messaging: availability and receiving controls
- Costs: token usage and team cost controls
- Settings: scope and precedence