One prompt goes in. A team of three agents comes back out.
You type a single natural-language request for a fictional AI startup landing page, and a front-end developer, a back-end developer and a QA agent spawn in parallel. The two developers hand their work to QA, QA finds three critical issues, the lead sends the work back to both developers, and the second pass clears all three. The site comes back with copy, colour scheme, animations – nearly done in one shot.
That result is real, and it is also expensive and slow. Teams run roughly three times the cost of a single session when you have three teammates, and they take longer. The quality jump only shows up when the prompt gives every teammate a job it can own.
This article is about making that happen: enabling the feature, caching the docs, writing a prompt the lead can actually delegate from, and recognising the moment a team is just burning tokens.
One Session Leads, Teammates Talk to Each Other

An agent team is a set of independent agents your main session spawns, all sharing one task list and all able to message each other directly. Your main session stays the orchestrator, basically the team lead, and that is the whole difference from subagents.
When the prompt asked for a team called NeuralFlow of three Sonnet teammates, a TeamCreate tool fired and three agents came up in parallel: a front-end developer, a back-end developer and a QA agent. Each one is its own agent, not a subroutine tucked inside the main session. That distinction sounds technical until you watch what it lets them do.
The peer channel is the point. The front-end and back-end developers sent their work over to QA. QA came back with three critical issues. The lead pushed all of it back to the two developers for another pass, and on the second try QA passed it clean.
Subagents do not do that. A subagent works alone, finishes its piece, and hands one result back to the main agent. Nothing goes sideways between workers. That is fine for a quick lookup or a focused rewrite, and it is hopeless when one worker's output is another worker's input.
So the loop is the real thing you are buying. A quality agent can look at finished work and say it is not good enough, and the lead is the one tracking what is done and what is still open. Without a teammate that can say no, you have parallel generation, not quality control.
Turn Teams On With One Project Setting

Agent teams are switched off by default because the feature is still experimental, the official Claude Code agent teams documentation says so plainly, and you turn them on with one JSON snippet at the project level.
Open the agent teams docs, copy the snippet they give you, and paste it into Claude Code with an instruction like: add this to the local settings for this project. That is the whole setup. A .claude folder appears with a settings.local.json inside it, carrying the setting.
Then confirm the file actually holds the variable before you celebrate. Go back to the official docs for the exact name and snippet rather than typing it from memory. One wrong character and nothing works, and the error will not tell you which character it was.
Worth knowing that the feature works wherever you run Claude Code, including the VS Code extension. The extension just shows you less of what is happening under the hood, which matters when you start watching agents talk to each other.
One habit that saves an hour: after any change to that settings file, ask the session to read it back and confirm the key is there. It is a ten-second check that catches the silent failure where teams stay disabled and you spend the next build wondering why nothing spawned.
Cache the Docs as a Local Reference Guide

Before you build anything, have the project read the manual once and keep it, so the agent consults a local markdown file instead of guessing at how teams behave.
Copy the agent teams documentation URL and ask for a master reference guide in a folder called docs. The file that comes back runs to hundreds of lines, covering enabling teams, when to use them, display modes, task management, hooks and best practices. Whenever the session has a question mid-build, it opens that markdown file rather than re-fetching the web page.
It pays off in the boring way: fewer round trips, less guessing, and a consistent answer about how a team is supposed to work. That consistency is what stops a teammate from inventing its own idea of task management halfway through.
The trick is not specific to agent teams either. Do the same for any big MCP server or any documentation your project looks at constantly, and you will notice the difference within a session.
One small catch: regenerate the file when the docs change. A stale local guide is worse than no guide, because the agent will trust it completely.
| Approach | Best for | Teammates message each other | Relative cost | Typical failure |
|---|---|---|---|---|
| Single session | One context, simple or sequential work | No | 1x | Runs out of room on multi-part jobs |
| Subagents | Focused, sequential tasks that hand one result back | No | Low overhead per worker | Result feels stitched, no review loop |
| Agent team (3-5) | Parallel specialist work with review | Yes, peer to peer | ~3x for three teammates | File collisions and token burn |
| Agent swarm (10+) | Rarely worth it | Yes | ~10x | Cost explodes for marginal quality |
The Prompt Names Goal, Size, Model and Roles

Write it in plain natural language, but follow a fixed pattern: create a team of X agents using Haiku, Sonnet or Opus, then give each agent its role, its tasks, its output and who it should message.
Lead with the goal. Spawned agents wake up with no context beyond what the lead feeds them, so the goal is the only thing orienting them. Something like: build a working full-stack app with a REST API and a React front-end, running on localhost:3000 with users and posts, plus a QA report confirming it works. Now every teammate knows what it is contributing to and why the others are beside it.
Then spell out the handoffs inside the role instructions. One agent gets told: message the front-end dev when you are done. Another gets: wait for the back-end dev's message, then send everything to QA. Vague coordination language turns into agents sitting idle, waiting for a message that never comes.
State the final deliverables up front. The running app, a pass/fail test report, and a short document covering what was built, the key decisions and how to run it next time. The lead collects all of this at the end, so your checklist is the thing keeping the output from turning into a pile of partial files.
And keep the cost in view while you write. Teams run slower and pricier than a normal session. That is a trade you make for quality, not a default.
Do's and Don'ts That Keep Work Unmixed

Most team disasters trace back to a prompt that left something unsaid, so five rules cover the ones that bite: own your files, define outputs precisely, name the recipients, stay small, and hand over full context.
Give every agent its own files. If two agents edit the same file, one overwrites the other and the deliverable comes back looking like it was assembled by strangers. Define outputs precisely too, because a vague deliverable gets you a vague file back.
Name the recipients explicitly. Do not assume an agent will work out who to talk to. Write the message direction into the role itself, so the front-end dev knows it reports to QA and not into the void.
Keep the team at about three to five teammates. A swarm of 10 or more costs roughly ten times as much and gives you coordination problems instead of quality. Give full context every time too, since no conversation history passes to teammates, even though they can read the project files and inherit your session's permissions, MCP servers and skills.
⚠️ COMMON MISTAKE
Don't leave file ownership implicit
If two teammates can write to the same file, assume they will. Name the files per agent in the prompt, then check the assignments before the team starts writing.
What a Real Three-Agent Run Looks Like

A real team run reads like a small project with a paper trail: a researcher, a strategist and a critic, all on Sonnet, working through a workspace to check accuracy and setup from top to bottom.
The first thing worth doing is clicking into any teammate. You see the exact prompt the lead sent it – the role, the job, the thoroughness instructions, and steps spelled out like sending your five use cases to the critic teammate using the SendMessage tool. Nothing is hidden from you. That prompt is your proof that peer messaging is actually wired up and not just advertised, because you can watch the instruction leave one agent and land in another.
The lead checks in while the work moves. In that run it asked the researcher whether both the strategist and the critic had received the structured inventory, and the researcher confirmed they had. Every update gets reported to you as the session progresses, so you are never guessing where things stand.
At the end, the lead messaged each agent that it was done and to save its work before shutting down. That clean shutdown matters more than it looks – a teammate can refuse the request and finish what it was doing first, which is exactly the behaviour you want and the reason you never just kill the run.
The output was one document, agent-teams-patterns, and it flagged 11 documentation gaps. One file, one owner, and a specific number a human can act on.
Split Panes in tmux Show Every Teammate

– once you run Claude Code inside tmux, every teammate gets its own pane and you can message any one of them directly. The VS Code extension does not give you that. There you see messages flow through the main session and little else, with no sense of what an individual teammate is thinking or doing, and no way to talk to one.
A terminal running tmux changes the picture. The front-end dev comes up in a blue pane, the back-end dev in green, the QA agent in yellow, all spawning in parallel with the task dependencies and owners already assigned. You watch them work, talk to each other and write files in real time, which is a completely different feeling from staring at a single scrolling log.
With split panes you get direct access: check team status with the lead, or message a single teammate to approve something or hand it more information without interrupting anyone else.
On Windows you need a workaround before tmux panes are available at all. The simplest route is to ask Claude Code to walk you through the install, since it can hand you the exact commands for your setup instead of you hunting through docs.
This is also how you catch a teammate heading down the wrong path early enough to shut it down before it spends a fortune being wrong. The pane is your early warning system – if the QA agent is arguing with the back-end dev about an endpoint, you see it now rather than after the bill lands.
Three Rules: Own Territory, Message, Parallel

The teams that work share three habits: they own their own territory, they message each other directly, and they run in parallel the whole way through. Break any one of the three and you get agents tripping over each other.
Own territory first. Each agent edits only its own file and owns its own deliverable, and work gets sent across rather than written into someone else's patch. The moment two agents open the same file, one of them silently overwrites the other and you spend an hour wondering why your fix vanished.
Message directly is the second rule. Teammates talk to each other without the main session sitting in the middle as a middleman. That peer-to-peer capability is the whole thing you paid for, so a prompt that funnels every exchange through the lead is wasting the feature.
Work in parallel and communicate throughout, not just at handoffs. If your process is really agent one to agent two to agent three in sequence, you do not need a team – and you may not need subagents either, just one focused session that does the lot.
Run that test before you spend anything: sketch the job as boxes and arrows, and if every arrow is a straight line forward, you have your answer.
Sequential handoff vs parallel team
Use a single session or subagents
- Steps run one, two, three with each depending on the last
- Everything must live in one context window
- The job is simple enough that parallel setup is overhead
- You want to save tokens and time
Use an agent team
- Several distinct specialties in one project
- Work genuinely runs in parallel
- Teammates need to assign tasks and talk throughout
- A high quality bar with many review steps
Teammates Inherit Permissions, Files, Servers and Skills

Every teammate starts with no conversation history but with the main session's permissions and the run of the whole project – and plan approval mode is the gate you put in front of it. The permissions carry over automatically. Run on bypass permissions and the entire team runs on bypass permissions; allow bash commands and every teammate inherits that too.
They can also read every project file and use the project's MCP servers and skills, so a teammate arrives already knowing your setup. Understanding how MCP works explains why those shared servers matter so much to a team.
That inheritance is convenient and slightly unnerving at once. A teammate that can do everything your session can do can also make every mistake your session can make, and it will make them in parallel where you cannot watch them all at once.
Plan approval is where you get control back. You can set it so the main session approves each teammate's plan before execution, so you personally approve every plan, or so one dedicated teammate acts as the plan reviewer. Main-session approval is the sensible default – it keeps a human-designed lead in the loop without making you the bottleneck. Approving every plan yourself is a fine brake while you learn the flow, then it starts to cost you real time on a five-agent run.
Pick the strictest option for your first run, then loosen it once you know what your team does with freedom.
🧭 A clean team run, start to finish
Enable and cache
Add the local settings snippet from the docs and generate the docs reference file.
Write the prompt
State the goal, team size and model, then each role, output and message recipient.
Spawn in parallel
The lead creates the task list and starts every teammate at once with its own file.
Watch and steer
In tmux, message one teammate directly or shut it down if it is going wrong.
Review loop
QA rejects the work, the lead routes it back, and the second pass clears the issues.
Clean shutdown
The lead tells each teammate to save its work and confirm before the session closes.
Six Common Failures and the Fix for Each

When a run starts going sideways, most of it lands in six predictable buckets, and each one has a small settings or prompt change that fixes it. Agents stopping every few seconds for permission prompts is the easy one: pre-approve the tools and commands in your project or local settings so the team can run without tapping you on the shoulder.
If deliverables come back feeling disjointed, suspect overwriting. Assign a file owner to every agent and re-check the assignments. An agent that seems to be doing nothing needs work or a dependency written into the plan – idle teammates are almost always a prompt problem, not a lazy model.
Burning through tokens means fewer agents, plain and simple. Lost work means telling agents to store everything as temporary files they can call on later, so nothing critical lives only in a context window that gets shut down. Wrong or off-target approvals point at the gate itself: approve plans yourself until you understand the flow, then hand approval back to the main session once you trust it.
The pattern under all six is the same – the team does what your settings and prompt told it to do, so fix those before you blame the agents.
💡 PRO TIP
Write the goal as an outcome, not a mood
Spawed agents only know what the lead tells them. 'Build a working full-stack app on localhost:3000 with users and posts' gives them something to check themselves against; 'make the project better' does not.
Run Subagents Alongside a Team

Keeping subagents in the mix while a team runs is not a clash, it is often the sharper split. Send the sequential, single-context parts of a project through a normal session or a subagent, and save the team for parallel specialist work that genuinely needs peers reacting to each other.
Think of it as routing, not choosing sides. A bit of research, a one-file refactor, a quick config change – none of that needs three opinions at once, and a subagent will do it without the coordination overhead. The team moves in when the front-end, back-end and QA work all need to happen at the same time and check each other's output.
One thing to hold loosely: whether a teammate can itself spawn subagents is an experimental, version-dependent detail. Check the current official agent teams documentation rather than assuming either way – that behaviour has moved before and it will move again.
File ownership is where mixing the two goes wrong. A subagent's output should never land in a file a teammate is midway through rewriting, so give the subagent its own paths and hand the result over as a separate file or a message. If the back-end agent is deep in server routes, let the subagent write a patch note to a fresh file instead of editing the route file underneath it.
Do that and you get the best of both: cheap focused sessions for the linear bits, a team for the parallel bits, and no two workers fighting over the same lines.
Use a Team Only for Parallel Specialties

Teams earn their cost only on complex work you can split across specialists who run in parallel and react to each other – everything else is cheaper as a single session or a subagent. So before you spin one up, ask whether the task actually fits that shape.
Good fits look like this: several distinct areas each needing its own specialist, work that genuinely runs in parallel, teammates assigning tasks and messaging throughout, and a quality bar with several review steps. Bad fits are just as clear – a one-two-three sequence, work that has to stay in one context window, several agents touching the same files, or a simple job one session handles cheaper.
The money makes the point. Cost grows with headcount, so three sessions costs roughly three times a single session, and ten teammates about ten times. Cap it at two to five agents and stay there; that is the practical ceiling, not a starting suggestion.
Then mind the lifecycle. If an agent heads down the wrong path, shut it down early rather than letting it burn tokens to a dead end. And finish with the clean shutdown where each teammate confirms its work is saved – force-killing the session leaves half-written files and confusion behind, and you will spend the next hour untangling which agent owned what.
Frequently Asked Questions
Are Claude Code agent teams available by default?
No. They ship disabled because the feature is experimental. You enable them per project by adding the documented JSON snippet to local settings, which creates .claude/settings.local.json. Check the official agent teams documentation for the exact variable name before you paste anything.
How many teammates should I use?
Three to five. That covers most projects with distinct specialist areas, and the cost stays roughly linear with headcount. Swarms of 10 or more cost around ten times a single session and create coordination problems that eat the quality gain.
Do teammates remember the conversation I had with the main session?
No conversation history is passed to them. They inherit the main session's permissions, can read project files, and can use your MCP servers and skills, but their context starts with whatever the lead feeds them. That is why the prompt has to state the goal, roles and deliverables explicitly.
Can I message one agent without going through the main session?
Yes, if you run Claude Code in a tmux terminal. Each teammate has its own pane – front-end in blue, back-end in green, QA in yellow in a three-agent run – and you can check status, approve work or add information directly. The VS Code extension shows communication only through the lead.
What happens if I just kill the session at the end?
You lose the chance for teammates to save their work first. The proper shutdown has the lead tell each agent it is done and to save, and each confirms before the session closes. If one is mid-way through something important, it can say so and finish first.
Sort the task first, then spawn the team
Here is the rule that saves the most money: if the job can be written as a numbered sequence, keep it in one session or hand it to a subagent. If it needs several specialists working at once and checking each other's output, a team of three to five is worth the slower, pricier run.
In your next project, make three moves in order. Enable the feature by asking Claude Code to put the documentation's snippet into local settings, and confirm the file holds it. Then point it at the agent teams docs and have it write the reference guide into a docs folder.
Finally, run one small team with a stated goal, a named file owner per agent and the closing deliverables spelled out. Approve the plans yourself until the flow feels familiar, then hand approval back to the main session – and always let the teammates save their work before you shut them down.
Check the setting before you spawn
Open your project's local settings file and confirm the agent teams snippet is in it. Nothing else in this article works until that one line is right.