Prove What Your Agent Team Actually Shipped
Verify parallel agent output in a real browser with natural-language objectives using TestMu AI.

Claude Code Agent Teams explained: how to enable them, spawn and control teammates, teams vs subagents, real use cases, token costs, and troubleshooting tips.

Samyak Goyal
Author

Anubhav Singhmaar
Reviewer
Published on: August 26, 2026
Claude Code Agent Teams are an experimental feature that puts several Claude Code sessions on one task at the same time, coordinated by a lead session. Every teammate holds a separate context window and messages the others directly instead of routing findings through the coordinator.
Anthropic's own Claude Code cost documentation prices that parallelism plainly: agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode, roughly double the three-to-four-times figure circulating in community write-ups.
This guide covers how to switch them on, the commands that control a team, when subagents win instead, and the cases where a single session still beats a team.
Overview
Claude Code Agent Teams let one Claude Code session act as a team lead that spawns other full Claude Code sessions as teammates. Each teammate keeps its own context window, claims work from a shared task list, and messages other teammates directly rather than reporting everything back through the lead.
How Do You Enable Agent Teams in Claude Code?
What Is the Difference Between Claude Code Agent Teams and Subagents?
Subagents run inside one session and hand a summarized result back to the caller, which keeps cost low and the main agent in charge. Teammates are independent sessions that talk to each other, which buys genuine debate and cross-checking at roughly seven times the token spend. Whichever you pick, the code still needs verifying in a real browser, which is where TestMu AI's Kane CLI fits.
Key Takeaways
Claude Code Agent Teams run several Claude Code sessions against one problem at once. One session leads, assigns work, and synthesizes results. The rest are teammates: independent sessions that message each other.
According to the Claude Code agent teams documentation, the feature is experimental and disabled by default, and the page currently describes behavior as of version 2.1.178. Two things separate it from every earlier parallelism option in Claude Code:
The practical effect is that a team can argue. Five teammates investigating five hypotheses can try to disprove each other, and the theory left standing is far more likely to be the real root cause than the first plausible answer a single session settles on. That is the capability you are buying with the extra tokens, and it is what separates the agent teams Claude Code ships today from ordinary parallel execution.
A team has four moving parts. Anthropic's agent teams documentation names them as the lead, the teammates, a shared task list, and a mailbox, and all four are ordinary files on your disk rather than a hosted service.
The team name is derived from your session, not chosen by you: it is the word session- followed by the first eight characters of the session ID. The team config lives at ~/.claude/teams/{team-name}/config.json and the task list at ~/.claude/tasks/{team-name}/.
Those two directories behave differently when the session ends. The team config directory is removed. The task list directory persists locally and is never uploaded, so a resumed session keeps its tasks, with retention governed by the same cleanupPeriodDays setting that controls session transcripts.
One detail worth internalizing before you build workflows on top of this: the team config holds live runtime state such as session IDs and terminal pane IDs. Editing it by hand or pre-authoring it does not work, because Claude Code overwrites your changes on the next state update. There is also no project-level equivalent, so a .claude/teams/teams.json in your repo is treated as an ordinary file, not configuration.
If the idea of independent agents coordinating through shared state is new to you, the pattern generalizes well beyond one vendor's CLI. Our guide to multi-agent AI systems covers the architectures and failure modes that apply to any implementation.
Both parallelize work, and confusing them is the most expensive mistake available here, because the wrong choice can multiply your token bill sevenfold for no benefit. The difference is who talks to whom.
| Dimension | Subagents | Agent teams |
|---|---|---|
| Context | Own context window, with results returned to the caller | Own context window, fully independent of the lead |
| Communication | Return a result to the caller; named subagents can message each other | Teammates message each other directly by name |
| Coordination | The main agent manages all work | Self-coordination through messages plus a shared task list |
| Your access | You interact through the main agent | You can open and message any teammate directly |
| Background work | Run in the background by default in interactive sessions | In-process teammates cannot run background subagents of their own |
| Token cost | Lower, because results are summarized back into one context | Roughly 7x a standard session when teammates plan, per Anthropic |
| Best for | Focused tasks where only the result matters | Work that needs discussion, challenge, and collaboration |
The decision rule is short. If you can describe the work as "go find out X and tell me," use a subagent. If the value depends on two workers disagreeing with each other, use a team.
Sequential work, same-file edits, and heavily dependent tasks are explicitly called out in the agent teams documentation as cases where a single session or subagents are more effective. Coordination overhead is real, and it grows faster than the parallelism gain.
Agent teams are off by default. Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1 to switch them on, either as a shell variable or, more durably, in the env block of your settings.json file.
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}You do not need to restart. Claude Code reapplies settings-file env values to the running session when you save, and rereads the variable each time it spawns an agent.
Before switching it on, it is worth confirming what the default state actually looks like, because the documentation's claim is easy to verify. On a machine where the variable has never been set, neither team directory exists at all:
$ echo $CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS
# empty, the flag was never set
$ ls ~/.claude/
commands debug ide plugins projects sessions settings.json skills
$ ls ~/.claude/teams/
ls: cannot access '/c/Users/<user>/.claude/teams/': No such file or directory
$ ls ~/.claude/tasks/
ls: cannot access '/c/Users/<user>/.claude/tasks/': No such file or directoryThat is a useful diagnostic to keep. If you believe teams are enabled but ~/.claude/teams/ is still missing after a session has started, the variable is not reaching Claude Code and no amount of prompt rewording will produce a teammate.
Two constraints catch people out immediately after enabling:
That second point is the single most disruptive side effect of the feature, and the fix is covered in the troubleshooting section below.
There is no create-team command. You describe the team you want in plain language and Claude spawns it. This prompt shape works because the three roles are independent and none of them waits on another:
Spawn three teammates to review PR #142:
- One focused on security implications
- One checking performance impact
- One validating test coverage
Have them each review and report findings.Name the teammates in your prompt if you plan to address them later, because the lead assigns names at spawn time and those names are how every message is routed. Telling the lead what to call each teammate is the only way to get names you can predict.
In the default in-process mode, teammates appear in a panel below your prompt input. The keys are worth memorizing because they are the entire interface:
While you are viewing a teammate, plain text and skills go to that teammate, but built-in slash commands still run in the lead's session. A teammate's model and fast mode are fixed at spawn, so /model and /fast only ever change the lead. From version 2.1.199 Claude Code shows a notice explaining this instead of silently applying it to the lead.
You can specify team size and model in the same sentence that creates the team, and Anthropic's cost guidance recommends Sonnet for teammates as the balance of capability and spend:
Spawn 4 teammates to refactor these modules in parallel. Use Sonnet for
each teammate.When your prompt names no model, the teammate runs on the lead's current model unless CLAUDE_CODE_SUBAGENT_MODEL is set. Teammates also inherit the lead's effort level, and /effort is the one setting that does apply to a teammate you are viewing.
For risky work, require a plan before any edit. The teammate stays in read-only plan mode, submits a plan to the lead, and revises on rejection until approved. The lead decides autonomously, so give it criteria rather than hoping:
Spawn an architect teammate to refactor the authentication module.
Require plan approval before they make any changes.
Only approve plans that include test coverage.Tasks are either assigned by the lead or self-claimed by a teammate that has finished its previous task. Claiming uses file locking, so two teammates racing for the same task do not both get it. To end a teammate cleanly, name it: asking the lead to have the researcher teammate shut down sends a shutdown request that the teammate can approve or reject with an explanation.
Most guides stop at the enable flag. Six further settings change how Claude Agent Teams behave: display mode, teammate model, cache lifetime, task retention, and one option removed in v2.1.234.
| Setting | Where it lives | What it does |
|---|---|---|
| CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS | env or settings.json env block | Turns agent teams on with 1 and off with 0. Off by default. |
| teammateMode | ~/.claude/settings.json | Display mode: in-process (default), auto, tmux, or iterm2 from v2.1.186. |
| --teammate-mode | CLI flag | Sets the display mode for one session. Experimental, and absent from claude --help. |
| CLAUDE_CODE_SUBAGENT_MODEL | environment variable | Model for teammates when the prompt names none. Otherwise the lead's model is used. |
| subagentPromptCacheTtl | settings.json | Set to 1h to extend an in-process teammate's cache beyond the five-minute default. |
| cleanupPeriodDays | settings.json | Governs retention of the persisted task list directory, as it does session transcripts. |
| teammateDefaultModel | removed in v2.1.234 | Ignored if left behind. Name the model in the prompt or use the subagent model variable. |
The cache setting is the one that costs money without announcing itself. An in-process teammate's requests fall outside the main conversation's cache bucket, so its cache holds for five minutes by default even on a subscription.
On a long-running team that means repeated cache misses, and each miss reprocesses that teammate's full context. Setting subagentPromptCacheTtl to 1h keeps it warm, at the cost of a higher billing rate for one-hour cache writes on the API.
If your organization restricts models through an availableModels allowlist, a blocked model name does not fail the spawn. Claude Code substitutes: a blocked family alias such as opus resolves to the newest permitted version of that family on the Anthropic API and on Claude Platform on AWS, and any other blocked value falls back to the lead's model.
Yes. A widely repeated claim says agent teams have no definition file, no YAML, and no schema, and exist only as prose you paste into the terminal. That reading was fair at launch but is no longer accurate.
The current agent teams documentation states that when spawning a teammate you can reference a subagent type from any subagent scope: project, user, plugin, or CLI-defined. A role defined once is reusable both as a delegated subagent and as a teammate.
Subagent definitions are YAML-frontmatter Markdown files. Project-scope roles live in .claude/agents/ and check into version control, and personal ones live in ~/.claude/agents/. Only name and description are required, per the Claude Code subagents documentation:
---
name: security-reviewer
description: Reviews auth and input handling for security defects.
tools: Read, Grep, Glob, Bash
model: sonnet
---
You are a senior security reviewer. Focus on token handling, session
management, and input validation. Report issues with severity ratings.Save that as .claude/agents/security-reviewer.md and spawn it by name, and the whole team composition becomes a reviewable artifact instead of a prompt someone has to remember:
Spawn a teammate using the security-reviewer agent type to audit the auth module.Two behaviors matter here and neither is obvious. The definition's body is appended to the teammate's system prompt as extra instructions rather than replacing it, and Claude Code adds SendMessage to the definition's tools allowlist so an in-process teammate can still communicate. In a session with the Task tools, it also adds TaskCreate, TaskGet, TaskList, and TaskUpdate.
The gap to plan around: the skills and mcpServers frontmatter fields are not applied when a definition runs as a teammate. Teammates load skills and MCP servers from your project and user settings instead, the same as a regular session. A role that depends on a scoped MCP server will not get one as a teammate.
Three hook events fire on team activity: TeammateIdle, TaskCreated, and TaskCompleted. Each uses exit code 2 to reject the action and send feedback, so you enforce rules without reading every transcript.
A TaskCompleted hook wired to your test suite turns "the teammate says it is done" into "the suite agrees it is done." The Claude Code hooks documentation covers the payload each event receives.
Permissions work differently from what most people expect. Teammates start with the lead's permission settings, including --dangerously-skip-permissions if the lead was launched with it. You cannot set per-teammate permission modes at spawn time, only change them afterwards, and every teammate's permission prompt surfaces in the lead session for you to approve.
The security model around inter-agent messages deserves attention if you run teams in auto mode. Claude Code tells a receiving agent that a message came from another Claude session rather than from you, so a teammate cannot approve a permission prompt on your behalf, and a teammate denied an action cannot relay it through another teammate to get around the check.
In auto mode the classifier adds two checks: it treats an approval claim relayed from another agent as untrusted input, and it reviews every message before delivery, including structured protocol messages such as shutdown requests and plan approval responses. A blocked message never reaches its recipient. That is a deliberate boundary against one compromised or confused agent escalating privileges across the team, and it is the same reasoning behind agent handoff testing, where the handoff itself is the thing most likely to fail.
You verify it outside the agent, in a real browser. One session producing unverified code is a review problem. Five sessions producing it in parallel is that same problem multiplied by five, arriving at once.
The structural issue is that coding agents operate on a closed surface: they read source code, write source code, and verify with unit tests, type checkers, and linters, all of which also operate on source code. None of them opens a viewport, clicks the button, and confirms the expected page loads. When a teammate reports "passed," it is reporting on the code surface only.
That produces a specific failure class: code that is technically correct while the user-facing result is broken. A button wired to the wrong API, a redirect that 404s, a form that never validates, a modal that will not close. Multiply that by parallel teammates who never saw each other's rendered output and the review burden lands on you.
TestMu AI's Kane CLI is built for exactly this seam. It is a deterministic browser agent for developers, AI coding agents, and CI/CD pipelines that validates rendered UI in a real Chrome browser using natural-language objectives, driving the page through the Chrome DevTools Protocol rather than a synthetic DOM.
The agent writes; Kane CLI proves. Install it and authenticate in two commands:

Agent Mode is what makes it usable from inside a team. Running with --agent --headless suppresses the interactive interface and emits structured NDJSON, one JSON object per line, with a terminal run_end event carrying status, summary, extracted values, token usage, and the Test Manager URL. A teammate can parse that without scraping prose.
npm install -g @testmuai/kane-cli
kane-cli login --username "$LT_USERNAME" --access-key "$LT_ACCESS_KEY"
kane-cli run "Sign in and confirm the dashboard loads" --agent --headlessUse basic auth rather than OAuth in agent contexts. OAuth opens a browser consent page, and an agent with no display server cannot click through it. The Kane CLI quick start documentation covers both flows.
You can also teach teammates to reach for verification unprompted. Installing the Kane CLI skill at .claude/skills/kane-cli/SKILL.md makes the agent recognize browser work, build the command, parse the NDJSON, and inspect failure screenshots on its own. Since teammates load project skills at spawn, a project-level skill reaches every teammate automatically.
For framework-level test code rather than browser verification, the open-source TestMu AI agent skills repository carries more than 40 MIT-licensed skills spanning Selenium, Playwright, Cypress, Appium, Jest, pytest, and others across 15+ languages. Install one, or all of them, in a single command:
npx agentskillsforall add https://github.com/LambdaTest/agent-skills.git --skill playwright-skillA worked example of this loop, where Claude Code writes a feature and Kane CLI verifies it, is in our walkthrough of verifying Claude Code output with Kane CLI.
Note: Five parallel teammates can write more code in an hour than you can review in a day. Kane CLI runs each change in a real Chrome browser and returns an evidence-backed pass or fail your pipeline can gate on. Try TestMu AI free!
The strongest use cases share one shape: work that splits cleanly by domain expertise, where those domains must reconcile before anything ships. Team size stays inside the recommended three-to-five range.
That last case is the one with the clearest mechanism behind it. Sequential investigation suffers from anchoring: once one theory is explored, everything after it is biased toward that theory. Independent investigators actively trying to refute each other break the anchor, which is why the surviving explanation is more trustworthy.
The same reasoning drives how these systems get tested once they leave your terminal. Our guide to multi agent testing covers verifying what a group of agents collectively did, rather than checking each one in isolation.
Skip a team when the work is sequential, touches the same files, or only needs an answer rather than a debate. Coordination overhead is close to fixed, so on a short task it is pure loss.
A widely upvoted r/ClaudeCode thread titled "Convince me that agent teams are not pointless" argues that they amount to expensive subagents, on the grounds that idle notifications flood the lead's context and that inter-agent discussion rarely produces value a subagent could not have delivered. The criticism has substance, and it is right for a large share of tasks.
Anthropic's own guidance agrees more than the marketing suggests. The documentation states that agent teams add coordination overhead, use significantly more tokens, and that for sequential tasks, same-file edits, or work with many dependencies, a single session or subagents are more effective. Skip a team when:
There is a second cost that does not appear on any bill. Letting a team run unattended increases the risk of wasted effort, so the documentation's advice is to check in, redirect approaches that are not working, and synthesize findings as they arrive. Five teammates running unsupervised for an hour can produce an hour of work in the wrong direction, five times over.
A reasonable default: reach for a team when the value depends on disagreement, and reach for subagents when it does not. If you are choosing between orchestration patterns more broadly, our breakdown of agentic AI orchestration patterns maps the trade-offs beyond a single tool.
Most reported problems are one of five things, and four are not bugs: the feature is off, an idle row is hidden rather than stopped, Claude chose subagents, a task status lagged, or permission prompts are queuing.
Check the enable flag first, then check whether the row was hidden rather than stopped. From v2.1.199 an idle teammate's row stays visible while any other agent is still working, and idle rows hide thirty seconds after the whole panel goes idle.
The teammate keeps running and stays addressable while hidden, and messaging it by name brings the row back. When more than three teammates are idle, the surplus rows collapse into a single counter row such as 2 idle agents, which Enter expands.
Claude also decides whether a task warrants a team, so it may have used subagents instead. Subagents and teammates share the same panel, so the panel alone does not confirm a team formed. Ask again and explicitly request an agent team.
This is the trap that breaks working automation. While teams are enabled, a subagent Claude names launches as a teammate, and the two report back differently: Claude receives a subagent's result on completion, but a teammate only sends an idle notification saying it stopped, without its output.
An orchestration flow waiting on subagent results stalls with no obvious error. Turn teams off to restore the old behavior:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "0"
}
}No new session is needed. One precedence detail matters: setting it to 0 in your user settings.json overrides a shell export, but project settings, local settings, and a --settings payload all apply after user settings, so a value of 1 in any of them wins. Managed settings apply last of all, so if your organization enables teams there, only an administrator can change it.
Task status can lag: teammates sometimes fail to mark a task complete, which blocks every task depending on it. Check whether the work is genuinely done, then update the status manually or tell the lead to nudge the teammate.
Teammates also stop after errors instead of recovering, so open the transcript, give direct instructions, or spawn a replacement. The lead can stop early too, deciding the team is finished before it is, in which case tell it to keep going.
Every teammate's permission request bubbles up to the lead, so a five-teammate team produces five streams of interruptions in one place. Pre-approve common operations in your permission settings before spawning, rather than approving them one at a time mid-run.
Start with a review, not an implementation. Enable the flag, then ask for three teammates to read your last pull request through a security lens, a performance lens, and a test-coverage lens.
Watch the panel while they work. Read-only tasks with clear boundaries show you the value of parallel exploration without the file-conflict risk of parallel implementation.
Then decide honestly whether the disagreement between those three reviewers was worth roughly seven times the tokens of one session. On research, review, and genuinely independent feature work it usually is. On sequential work it never is, and no prompt fixes that.
Whichever way that lands, the verification gap stays open: parallel agents produce more code than any human can review at the same rate. Install the Kane CLI skill so teammates verify their own work in a real browser, or read how TestMu AI's Agent Testing platform evaluates the agents themselves once they reach production.
Author
Samyak Goyal is a Senior Member of Technical Staff at TestMu AI engineering Kane CLI, the command-line tool that runs browser automation from the terminal, where a flow described in natural language executes in a real Chrome browser and returns pass or fail with shareable proof. He is a backend engineer with 4+ years of experience, previously an SDE at Innovaccer, where he built APIs, introduced Kafka, and cut deployment from weeks to hours. Samyak also builds multi-agent systems, skill-orchestration frameworks, and a personal copilot that indexes 200+ microservice repositories.
Reviewer
Anubhav Singhmaar is an AI Product Manager at TestMu AI driving Kane CLI, the command-line tool that brings browser automation to the terminal, turning natural-language flows into runs in a real Chrome browser that return pass or fail with shareable proof. He owns the roadmap and prioritization and works with engineering to ship developer-facing features. Before TestMu AI, he spent over four years at Sprinklr owning enterprise voice AI across APAC and EMEA. A mechanical engineer turned product manager, he grounds guidance in real QA workflows.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance