Claude Code Agent Teams: Give Subagents a Shared Workspace
How Claude Code agent teams work (a lead, teammates, a shared task list and messages), how they differ from subagents, how to turn them on, and where a team's spreadsheets, documents and decks should go so the people who asked for them can use them.
Claude Code can split one job across several agents in two ways. Subagents are helpers the main session sends off with a task; each works in its own context and returns a summary. Agent teams, an experimental feature, go further: one session leads, several teammates work at once, and they share a task list and message each other directly.
Both make more output faster. Neither decides where that output goes when it is for people outside the terminal: a pricing analysis for finance, a brief for marketing, a deck for the board. This guide explains how agent teams work, using Anthropic's documentation, and how to give a team a shared workspace for that kind of work.
Key takeaways
- Agent teams are experimental and off by default. Turn them on with
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1in your environment or insettings.json.- A team has a lead, teammates that are each a separate Claude Code session, a shared task list and a mailbox for messages between them.
- Teammates load the same MCP servers as a regular session, so each can work in the same shared workspace.
- Give each teammate its own file or item: Anthropic warns that two teammates editing the same file leads to overwrites.
Agent teams in one paragraph
Anthropic describes agent teams as a way to "coordinate multiple Claude Code instances working together. One session acts as the team lead, coordinating work, assigning tasks, and synthesizing results. Teammates work independently, each in its own context window, and communicate directly with each other." You can also talk to any teammate yourself, without going through the lead.
Subagents or an agent team?
| Subagents | Agent teams | |
|---|---|---|
| Context | Their own; results go back to the session that called them | Their own; each teammate is fully independent |
| Talking to each other | They return a result; named subagents can also message each other | Teammates message each other directly |
| Who coordinates | The main session manages all the work | The teammates, through messages and a shared task list |
| Best for | Focused tasks where only the result matters | Work that needs discussion and collaboration |
| Token cost | Lower | Higher: each teammate is a separate Claude instance |
Subagents are defined as files in .claude/agents/ for one project, or ~/.claude/agents/ for all of yours, and inherit the MCP tools of the main conversation. Anthropic recommends agent teams for research and review, new modules each owned by one teammate, debugging with competing hypotheses, and changes that cross the frontend, backend and tests.
Turn agent teams on
Agent teams are off by default. Set the variable in your shell, or in settings.json:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
Then ask for a team in plain words, and say what each teammate does:
Spawn three teammates to review PR #142: one on security, one on performance, one on test coverage.
A few rules from the documentation:
- Interactive sessions only. With
-p, and in Agent SDK sessions, Claude doesn't spawn teammates. - One team per session, and only the lead manages it: teammates can't start their own teams.
- Three to five teammates is the suggested start for most work, with five or six tasks each.
- Display: teammates run inside your terminal by default; split panes need tmux or iTerm2.
How a team shares work
A team's shared state lives on your computer. Each agent's mailbox is a file under ~/.claude/teams/, and the task list is under ~/.claude/tasks/. The lead creates tasks, teammates claim them (task claiming uses file locking, so two teammates can't take the same one), and Claude Code unblocks a task when the tasks it depends on are done.
What the teammates make is ordinary Claude Code output: files in your project folder and text in their sessions. That suits code, which goes into a pull request. It suits a spreadsheet, a document or a deck for another team less, because those people are not in your terminal or your repository.
Give the team a shared workspace
The same thing that lets a single session publish work for a team works for a team of sessions: an MCP server for a workspace people use. Anthropic's documentation says each teammate "loads the same project context as a regular session: CLAUDE.md, MCP servers, and skills." Add a workspace's MCP server once, at user or project scope, and every teammate can use it.
With Artifacts (tryartifacts.com), the office for AI agents, that looks like this:
-
Connect Claude Code once. Make an agent key in Artifacts' settings and add the server:
claude mcp add --transport http --scope user artifacts https://tryartifacts.com/mcp --header "Authorization: Bearer fk_…" -
Give each teammate its own item. Anthropic's advice for files applies to items too: split the work so no two teammates edit the same thing. For example:
Spawn three teammates for the Q4 pricing review, all working in the Artifacts space "Pricing". - analyst: build the pricing analysis as an Artifacts spreadsheet from pricing.csv - writer: write the recommendation as an Artifacts document, reading the analyst's sheet - designer: make a six-slide Artifacts deck from the sheet and the document Each checks its own item and sends me its link. -
The team takes it from there. The finance team edits the spreadsheet live, comments on a cell, and @mentions the agent in the space's chat for changes. The spreadsheet downloads as Excel, the document as Word and the deck as PowerPoint.
Every teammate connects with the same key, so in Artifacts their work shows under the one agent name that key has. To tell teammates apart there, give each its own key and name in Artifacts and its own MCP server entry in its subagent definition, which split-pane teammates apply.
Limits to know
Agent teams are experimental, and Anthropic lists these limitations:
/resumeand/rewinddon't bring back in-process teammates.- Teammates sometimes fail to mark tasks as completed, which blocks the tasks that depend on them.
- Shutting down can be slow, because teammates finish their current request first.
- The lead is fixed for the session's lifetime.
- Split panes don't work in VS Code's integrated terminal, Windows Terminal or Ghostty.
Frequently asked questions
How do I enable agent teams in Claude Code?
Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1 in your shell or in the env section of settings.json, then ask Claude for teammates in an interactive session.
Can subagents and teammates use MCP servers?
Yes. Subagents inherit the MCP tools of the main conversation, and teammates load the same MCP servers as a regular session from your project and user settings.
How many teammates should I use?
Anthropic suggests starting with three to five. Each teammate has its own context window, so token use grows with every teammate, and more teammates mean more coordination.
Where should a team's documents and spreadsheets go?
Code goes in the repository. Work for people outside it is best created in a workspace they already use, through that workspace's MCP server, so they can open, edit and comment on it. See how to share Claude Code output with your team.


