Skip to content
zero2vibecodelearn vibe coding
Level 4 · Parallel work 10 min Reviewed by the author · Oct 15, 2026 Verified against Claude Code v2.1.292 · Oct 15, 2026Official docs: Agent teamsSomething out of date? Tell us

Agent teams (experimental)

An agent team is several Claude Code sessions where your session is the lead and the teammates message each other directly. The feature is experimental and off by default. Turn it on only for specific sessions, build teammates from read-only definitions, and stop them by name.

Level 4 · 0 / 4 lessons0%
In this lesson

In the lesson on choosing a pattern, the agent team came last: you need it when the workers have to talk to each other. It is an experimental feature, off by default.

How a team works

An is several Claude Code sessions working together. Your session is the lead: it spawns teammates, each in its own context. Teammates message each other directly, and you can message any of them too. , by contrast, mostly just return a result.

A teammate loads your , MCP servers and skills, plus the task from the lead — but not the lead’s conversation. So everything the task needs has to be in the task.

Turn it on for one session

Do not turn teams on globally. Make a separate file, for example .claude/team.json:

{
  "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" },
  "teammateMode": "in-process",
  "hooks": {
    "TeammateIdle": [
      { "hooks": [ { "type": "command", "command": "jq -r '.teammate_name' >> \"$CLAUDE_PROJECT_DIR/.claude/teammates.log\"" } ] }
    ]
  }
}
  • env turns teams on only for sessions started with this file;
  • teammateMode: "in-process" keeps teammates right in your terminal — it works in any terminal;
  • the TeammateIdle hook fires when a teammate is about to go idle and logs its name. That is your proof the team formed: in the bottom panel, subagents and teammates look the same.

Starting the lead:

CLAUDE_CODE_ENABLE_TODO_TOOLS=1 claude --settings .claude/team.json

CLAUDE_CODE_ENABLE_TODO_TOOLS=1 gives the session task tools on any model. Without it, those tools exist only on some older models, and on the rest teammates coordinate by messages alone, with no shared task list. Ctrl+T shows and hides the list itself.

Teammates from your definitions

Name a subagent definition in the task, and the teammate gets its tools, instructions and model, unless the task specifies a different model. Read-only reviewers with the line tools: Read, Grep, Glob are a good choice: they read and search, but do not edit files or run commands.

Create an agent team to review the change saved in .claude/review.diff. Spawn two teammates:
one named security, using the security-reviewer agent type, and one named tests, using the
test-reviewer agent type. When both have reported, write one combined report.

Claude Code spawns teammates without asking. When the work is done, stop them by name:

Ask the security and tests teammates to shut down.

Each one either agrees and exits, or declines and explains why. A teammate whose row disappeared from the panel is hidden, not stopped — name it too.

Competing hypotheses

The strongest use is debugging when the cause of a bug is unknown. Make a read-only hypothesis-tester definition and ask the lead to spawn three teammates: each owns one hypothesis and messages the others to challenge theirs. The lead records the explanation that survived the debate and the hypotheses that fell away.

Quick check

Two teammates edit the same file. How does that end?

Careful

Practice in the terminal

Check your understanding

Answered 0/3
Mode:

How is an agent team different from subagents?

You turned agent teams on in your user settings and asked "start the security-reviewer subagent". What can happen?

You came back to a conversation with /resume. Where are the teammates that were working in the terminal?

Finish the task in the terminal and answer the questions to complete the lesson.

📝 My notes

Saved automatically in this browser · shows up on the Notes page.

Task

Prepare a team: check that the test-reviewer reviewer only reads, make a hypothesis-tester copy of it, and write a .claude/team.json file that turns agent teams on only for sessions started with it.

Tab complete · ↑ history · Ctrl+L clear · help commands

  • Not done: The reviewer only reads and searches
  • Not done: The hypothesis-tester definition exists
  • Not done: Teams are turned on in a separate file
  • Not done: A TeammateIdle hook logs teammate names

Lesson Q&A

How is an agent team different from subagents?

Teammates are separate sessions that message each other directly, and you can message any of them; subagents mostly return a result to whoever called them — Your session is the lead: it spawns teammates, each in its own context. Teammates talk to each other, so they suit debates about a bug's cause or reviews from different angles.

You turned agent teams on in your user settings and asked "start the security-reviewer subagent". What can happen?

A subagent Claude names starts as a teammate — a team forms even though you did not ask for one — While teams are on, a named subagent starts as a teammate. That is why you turn teams on only for specific sessions through --settings, not globally.

You came back to a conversation with /resume. Where are the teammates that were working in the terminal?

Gone — /resume and /rewind do not bring back in-process teammates; ask the lead to spawn new ones — The team config is deleted at the end of the session, but the task list is kept. The teammates themselves have to be spawned again after resuming.

Two teammates edit the same file. How does that end?

Teammates work in your shared working folder, not in separate worktrees. Split the files between them.

Commands in this lesson

Terms in this lesson

Move between lessons with ← → · search with ⌘K

Written and reviewed by Mikhail Kuzmitskii