Claude Code agent teams: setup, cost and parallel runs
Updated December 2026.
Claude Code agent teams let one Claude Code session, the lead, start several teammates that each work in their own context window, share a task list and message each other directly. The feature is experimental and off by default. To turn it on, set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in your shell or in the env block of settings.json, start claude interactively and ask for teammates in plain language. Every teammate is a separate Claude instance, so a team uses more tokens than one session: about 7x when teammates run in plan mode, per Anthropic's cost page.
A team lives inside the lead's process, so it stops when your laptop sleeps. To keep it working, run the lead on a remote machine. On Lizard (lizard.build), lizard sandbox create -t claude -s small --timeout 3600000 starts a Small sandbox with Claude Code installed for one hour, at $0.0162 an hour. Open a shell in it with lizard sandbox ssh, start claude inside tmux and detach. One hour is the most a trial sandbox gets; longer runs need a paid plan.
We ran one code review three ways on 15 November 2026 with Claude Code 2.1.286. One session cost $0.169, three subagents $0.340 and three separate sandboxes $0.414. With claude -p the flag was on and Claude Code still launched ordinary subagents.
What are Claude Code agent teams?
Claude Code agent teams are groups of Claude Code sessions that work on one job together. One session, the team lead, spawns teammates, hands out tasks and combines the results. Each teammate is a full Claude Code instance with its own context window, and teammates can message each other without going through the lead.
Anthropic's agent teams documentation (checked 15 November 2026) lists four parts:
- The team lead: the main session that spawns teammates and coordinates the work.
- Teammates: separate Claude Code instances that work on assigned tasks.
- The task list: shared work items with three states (pending, in progress, completed) that teammates claim.
- The mailbox: a JSON file per agent at
~/.claude/teams/{team-name}/inboxes/{agent-name}.json.
A teammate loads the same project context as a normal session (CLAUDE.md, MCP servers, skills) and the lead's spawn prompt, but not the lead's conversation history.
The same page names the limits: a session has one team, teammates cannot spawn their own teammates, and /resume does not bring back in-process teammates. Anthropic recommends 3 to 5 teammates for most work and sets no hard limit.
How do you enable agent teams?
You enable agent teams by setting the CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS environment variable to 1. Anthropic's docs still mark the feature "experimental and disabled by default" as of 15 November 2026. Put the variable in settings.json, either in ~/.claude/settings.json for every project or in .claude/settings.json for one repository:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}With this file in a repository's .claude/settings.json, echo $CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS run by Claude Code 2.1.286 printed 1.
Then start claude and describe the team:
Create an agent team with three teammates named security, performance and
coverage. Each one reviews src/ from its own angle and reports its top 3
findings to you.Three rules from Anthropic's docs decide whether a team forms:
- The session must be interactive. "In non-interactive mode with the
-pflag, including Agent SDK sessions, Claude doesn't spawn teammates," and a named subagent runs as an ordinary subagent even with the flag on. Our test with Claude Code 2.1.286 showed the same. See Claude Code headless mode for what-pdoes otherwise. - Claude may still pick subagents. Subagents and teammates appear in the same agent panel, so the panel does not prove a team formed. If you got subagents, ask again for an agent team by name.
- With the flag on, any subagent that Claude names launches as a teammate, so a team can form when you did not ask for one. Set the variable to
0to turn that off.
Teammates run inside the lead's terminal by default: pick one with the arrow keys in the agent panel and press Enter to open it. For one pane per teammate, set "teammateMode": "auto" in ~/.claude/settings.json and run Claude Code inside tmux or iTerm2.
A new teammate starts in the lead's permission mode (Manual if the lead is in dontAsk mode), and you cannot set a mode per teammate at spawn time. A lead started with --dangerously-skip-permissions passes that on to every teammate. Our guide to the flag covers what it skips and how to contain it. In auto mode, the classifier reviews each message between agents before it is delivered.
How much do agent teams cost?
Agent teams cost roughly in proportion to their size, because each teammate fills its own context window. Anthropic's docs give one figure: "Agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode." They also say token usage "scales with the number of active teammates and how long each one runs."
We measured the two alternatives that run headless, subagents and separate sandboxes, against one session. The task was a review of pallets/itsdangerous (1,657 lines of Python with tests, commit 672971d) for security, performance and test coverage, with three findings each written to REVIEW.md. Every run used Claude Code 2.1.286 with claude -p and the model claude-sonnet-5-5, in a Small sandbox on Lizard, on 15 November 2026. Each setup ran once.
| Setup | Requests | Tokens, cache reads included | Cost reported by Claude Code | Time |
|---|---|---|---|---|
| One session, no delegation | 6 | 165,887 | $0.169 | 26 s |
Flag on, team requested, claude -p: three subagents | 19 | 341,810 | $0.340 | 36 s |
| Three forked sandboxes, one reviewer each | 17 | 431,196 | $0.414 in total | 33 s |
Splitting this review across three workers cost 2.0 times one session with subagents and 2.4 times with three separate sessions. It did not finish sooner, because one session read the whole small repository in 26 seconds.
The token column comes from the transcript files in ~/.claude/projects and counts cached input. In the single session, 135,134 of the 165,887 tokens were cache reads, which cost less than fresh input, so compare the dollar column.
In the second run the prompt asked for an agent team and the session printed TEAMS=1. Claude Code launched three ordinary subagents, and the lead reported that they "did not coordinate with each other."
We did not measure a real interactive team. It needs a signed-in interactive session, and our test project's Claude credential reaches only headless runs. Anthropic's 7x is the figure for a team in plan mode; our 2.0x is what the subagent fallback cost.
To spend less, Anthropic's cost page says to use Sonnet for teammates, keep the team small and shut teammates down when they finish, since "each active teammate continues consuming tokens until it exits."
Agent teams vs subagents vs git worktrees vs separate sandboxes: which should you use?
Use subagents when only the result matters and agent teams when the workers need to talk to each other. Use git worktrees when you run the sessions yourself and want their edits apart. Use separate sandboxes when each agent needs its own machine or must keep running without your laptop.
| Agent teams | Subagents | Git worktrees | Separate sandboxes | |
|---|---|---|---|---|
| Isolation between agents | Own context window; same working directory and machine | Own context window; same working directory unless the subagent is given a worktree | Own directory and branch; same machine, same local services | Own kernel, file system, processes and ports |
| Shared files | Yes. Two teammates editing one file overwrite each other | Yes | No. Each has a checkout of the same repository | No. Each has a full copy |
| Coordination | Shared task list and direct messages | Each reports back to the caller | You, or cross-session messaging | You: collect a patch from each sandbox |
| Token cost | Highest: about 7x a session in plan mode (Anthropic) | 2.0x one session in our run | One session's cost per worktree | One session's cost per sandbox; 2.4x in total in our run |
Works with claude -p | No | Yes | Yes | Yes |
| Survives a closed laptop | Only if the lead runs on a remote machine | Only if the session runs on a remote machine | Only if the sessions run on a remote machine | Yes, until the sandbox's deadline |
| Best for | Review and research where workers challenge each other; debugging with competing hypotheses | Focused tasks that return a summary | Parallel features in one repository | Risky commands, conflicting ports or dependencies, trying several approaches at once |
The team, subagent and worktree columns come from Anthropic's pages on agent teams, subagents and worktrees, checked 15 November 2026. claude --worktree feature-auth creates .claude/worktrees/feature-auth/ on a new branch named worktree-feature-auth.
Teams and worktrees do not combine through the Agent tool. Per Anthropic's docs, an Agent call that passes isolation launches a subagent, not a teammate. Teammates share the lead's checkout, so give each one its own set of files.
A worktree separates files only. Two sessions in two worktrees still share one database, one set of ports and one home directory. A sandbox per agent removes that overlap; Claude Code sandbox covers what each kind of isolation protects.
How do you run several Claude Code agents in parallel in the cloud?
You run several Claude Code agents in the cloud in one of three ways: a team inside one remote machine, subagents from one headless prompt, or one agent per machine. All three start with a sandbox that has your repository in it:
lizard sandbox create -t claude -s small --timeout 3600000
SB=<the sandbox ID the command prints>
lizard sandbox exec $SB -- git clone https://github.com/your-org/your-app /root/appLizard Sandboxes are Firecracker microVMs, each with its own kernel. A Small sandbox has 2 vCPU, 4 GB of RAM and a 20 GB disk for $0.0162 an hour, billed per second while it runs, idle time included (pricing, checked 15 November 2026). Lizard CLI gives a sandbox 5 minutes unless --timeout says otherwise. During the 7-day trial every sandbox is deleted 1 hour after it starts at the latest; on a paid plan the longest lifetime is about 596 hours (limits). Move the deadline of a running sandbox with lizard sandbox timeout $SB 7200000.
A team in one sandbox
A real team needs an interactive session, so open a shell and keep it alive with tmux:
lizard sandbox ssh $SB
apt-get update && apt-get install -y tmux
tmux new -s team
export CLAUDE_CODE_OAUTH_TOKEN=<token from claude setup-token>
cd /root/app && claudeSet CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in settings.json and ask for the team. Detach with Ctrl-b d and close the laptop. Later, lizard sandbox ssh $SB and tmux attach -t team bring you back to the lead.
The export line is needed because a credential connected with lizard agents add claude reaches only lizard sandbox prompt runs, as the Run Claude Code in a sandbox guide says. In our test an interactive claude in the sandbox opened on the login screen.
Do not pause the sandbox while the team works. A pause keeps files and ends running processes, so the lead and its teammates are gone when it resumes.
One prompt, subagents
lizard sandbox prompt $SB --agent claude --cwd /root/app "review src/ with three subagents: security, performance, coverage" runs claude -p in the sandbox and keeps working after you press Ctrl-C. It is the simplest way to leave work running, and it gives you subagents, not a team. In our test that run cost $0.340, against $0.169 for one session.
One agent per sandbox
For full isolation, fork the prepared sandbox and send each copy its own prompt:
lizard sandbox fork $SB -n 3
lizard sandbox prompt <fork-1> --agent claude --cwd /root/app "review src/ for security only"
lizard sandbox prompt <fork-2> --agent claude --cwd /root/app "review src/ for performance only"
lizard sandbox prompt <fork-3> --agent claude --cwd /root/app "review src/ for test coverage only"A fork copies files only. Each fork boots fresh from a copy of the source's disk, with no memory and no running processes, and the source keeps running. So prepare first and start the agents after: clone the repository and install its dependencies in one sandbox, fork it, then start Claude Code in each fork with lizard sandbox prompt, as in the block above. A tmux session or a claude process running in the source is not in the forks, so start it again in each fork if you need it.
When we reran this on 1 December 2026, fork -n 3 returned three running Small sandboxes in 1.7 seconds. Each fork had the cloned repository and a file written before the fork, and none had the sleep 600 process that was still running in the source. Three Small forks for 15 minutes cost $0.012 of compute (3 × $0.0162 × 0.25 h). The three reviews in the 15 November run cost $0.414 in model usage.
Parallel forks need a paid plan. The trial runs 1 Small at a time, and a fork counts as one more sandbox of its source's size, so forking a running Small is refused. Lizard Pro ($19 a month with $19 of usage included) runs up to 40 vCPU at once, which is 20 Small sandboxes.
For running several attempts at the same task and picking the best, see background coding agents.
How was this tested?
The tests ran on 15 November 2026 with Lizard CLI 4.0.128 and the claude template, which had Claude Code 2.1.286.
- Run in a real sandbox:
sandbox create,exec,fork -n 3,timeoutandrm, the tmux install (tmux 3.3a on Debian 12), a tmux session that was still there on the next connection, thesettings.jsonflag and the three measured reviews. - The agent runs were tested through the API that
lizard sandbox promptcalls. Thepromptandsshflags were checked with--help; nobody typed into thesshshell or rantmux attachby hand. - Not run: an interactive agent team, split-pane mode and
claude --worktree. What the article says about them comes from Anthropic's documentation. - The fork step was rerun on 1 December 2026 with Lizard CLI 4.0.136, after forks changed to copy files only:
sandbox create,exec,fork -n 3andrmin real Small sandboxes, then one review prompt in each of three forks, started through the same API. The costs in the table are from the 15 November run. - Each cost is a single run on a small repository, so a large codebase will give different ratios.
FAQ
Are Claude Code agent teams still experimental? Yes. Anthropic's documentation, checked on 15 November 2026, says agent teams are "experimental and disabled by default" and lists known limitations around session resumption, task coordination and shutdown.
Do agent teams work with claude -p or the Agent SDK? No. Anthropic's docs say Claude does not spawn teammates in non-interactive mode. In our test with Claude Code 2.1.286 the flag was set, the prompt asked for a team, and three ordinary subagents ran instead.
Can teammates use a different model from the lead? Yes. Name the model in the spawn prompt, for example "Use Sonnet for each teammate". Otherwise a teammate takes the model from its subagent definition, then from CLAUDE_CODE_SUBAGENT_MODEL, then the lead's model.
Does an agent team keep running when I close my laptop? Not on the laptop: in-process teammates run inside the lead's process. Run the lead inside tmux on a remote machine, such as a sandbox on Lizard, and it keeps working until the sandbox's deadline, which is 1 hour at most on the trial.
Can I resume an agent team later? Only partly. /resume and /rewind do not restore in-process teammates, so after a resume you tell the lead to spawn new ones.
Build with AI. Ship with Lizard
You don't need a platform team to go live. Your whole cloud, one CLI command away.
- Services
- —
- Add-ons
- —
- Deployments
- —
- Sandbox starts
- —