Claude Code tutorial · Updated Sep 2026

Claude Code Agent Teams Tutorial: 15 Steps From Setup to Shutdown

Agent teams give every teammate its own Claude Code session, a shared task list and direct chat with each other. This screenshot walkthrough covers the settings.json flag, your first spawn, steering, shutdown — and the limits nobody tells you about.

The short version

  • Agent teams are experimental and off by default: add "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" to the env block of settings.json, then run Claude Code v2.1.32 or newer.
  • You must say the words — ask Claude to "create an agent team" and name the teammates or the model, or it will quietly spawn ordinary subagents instead.
  • Teammates never inherit your conversation history — hand them a context file and keep every task small enough to produce one clear deliverable.
  • Every teammate is a separate Claude Code instance with its own context window, so tokens multiply — downgrade teammates to Sonnet or Haiku when the task allows and check /cost after each run.

Claude Code Agent Teams (Full Tutorial): The BEST FEATURE of Claude Code is HERE!

Video:AICodeKing13:58

Watch on YouTube

Agent teams — Orchestrate teams of Claude Code sessions

Docs:code.claude.comDocs

Watch on YouTube

Agent teams are experimental: expect rough edges around session resumption, task status and shutdown timing. Every command, settings key and shortcut on this page was re-checked against the official agent teams docs before publishing.

Screenshots come from AICodeKing's screen recording; the walkthroughs by Bart Slodyczka and Simon Scrapes supplied additional hands-on facts. All sources are credited and linked, and every step deep-links back to the exact moment in the video.

From a cold terminal to a shut-down team

1. Enable agent teams and verify your setup

  1. 1

    Find the agent teams docs and read the experimental warning

    Agent teams live in the Build with Claude Code section of the official docs. The page opens with an orange banner: the feature is experimental, disabled by default, and has known limitations around session resumption, task coordination and shutdown. Read that banner before you flip any flags.

    Claude Code Docs page for Orchestrate teams of Claude Code sessions showing the orange experimental warning that agent teams must be enabled by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to your settings.json environment
    The official agent teams page and its experimental-feature banner.Watch at 0:20
  2. 2

    Decide between subagents and agent teams

    The docs include a comparison table. Subagents run inside a single session, report results back to the caller and cost fewer tokens. Teammates are independent Claude Code instances that message each other directly and share a task list — you pay more tokens for real collaboration. Use subagents when only the result matters; use a team when workers need to challenge each other.

    Official Claude Code documentation table comparing Subagents and Agent teams across context, communication, coordination, best for and token cost, with the caption use subagents for quick focused workers and agent teams when teammates must coordinate
    Subagents vs agent teams, straight from the official comparison table.Watch at 1:00
  3. 3

    Enable the flag in settings.json

    Open (or create) ~/.claude/settings.json and add an env block with "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1". Project-level and local settings files can enable it too, and a shell export works — but a "0" in user settings overrides the shell export. The change applies to a running session without a restart.

    VS Code editing settings.json with an env block setting CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to the string 1, the flag that switches on Claude Code agent teams
    The env block that turns agent teams on.Watch at 2:00
  4. 4

    Update Claude Code, launch, and ask for a team in plain words

    Run claude update first — teams need a recent build (2.1.32 or newer), and older versions silently ignore the flag. Start Claude, check the model picker (the video uses Opus 4.6 on Claude Max), then type a prompt that says the magic words: "Use the agent teams feature." Without that phrase Claude spawns ordinary subagents instead.

    Claude Code v2.1.34 welcome banner showing Opus 4.6 and Claude Max in the ~/claude-agent-test directory while the prompt Make me a minesweeper game. Use the agent teams feature is being typed
    Claude Code v2.1.34 receiving the agent-teams prompt.Watch at 3:30

2. Spawn your first team

  1. 5

    Watch the lead break the work into a shared task list

    The lead turns your prompt into tasks, then spawns teammates. Each teammate's entry shows its task and "shift+↑ to manage". Notice the dependency marker: "Build UI, styling, and user interaction > blocked by #1" — the UI teammate cannot claim its task until the engine teammate finishes, which is how the shared task list prevents duplicated work.

    Claude Code reporting 2 agents launched with the engine-dev and ui-dev teammates, their task names manageable with shift+up, and the second task marked blocked by #1 in the shared task list
    Two teammates launched, with task #2 blocked by task #1.Watch at 4:30
  2. 6

    Let them run and read the live progress

    Teammates work in parallel in their own sessions. The lead narrates the state — "Both agents are working" — while each task line carries the teammate's name, elapsed time and token spend. Press ctrl+o to expand an entry and ctrl+t to show or hide the teammates panel at any time.

    Claude Code team lead summarizing two agents working in parallel while the engine-dev teammate builds game.js for 1 minute 28 seconds and 35.1k tokens under the task Build game engine and core logic
    Parallel work with per-task token and time accounting.Watch at 5:00
  3. 7

    Optional: pin the teammate count and their model

    You can specify exactly what you want: "Create a team with 4 teammates to refactor these modules in parallel. Use Sonnet for each teammate." Naming a cheaper model per teammate is the single best cost lever — routine work doesn't need Opus. For risky tasks, also require plan approval so a teammate's plan waits for your sign-off before any code is written.

    Claude Code Docs section Specify teammates and models with the example prompt create a team with 4 teammates to refactor these modules in parallel, use Sonnet for each teammate, plus the Require plan approval for teammates option
    The docs' own example for specifying teammates and models.Watch at 6:30

3. Steer, verify and iterate

  1. 8

    Follow the dependency hand-off and the lead's review

    When the engine teammate finishes, task #2 flips to unblocked and the UI dev picks it up. The lead then reads the changed files itself — "Let me shut down the teammates and do a final review of the code to make sure everything integrates properly." You intervene only if something looks wrong.

    Claude Code team lead announcing that task #1 is complete so task #2 is now unblocked for the UI dev, then reading files for a final integration review before shutting the teammates down
    Task #1 complete, task #2 unblocked, final review starting.Watch at 7:30
  2. 9

    Open the deliverable and verify it yourself

    The team's output lands as ordinary files in your project — here a Minesweeper game with three difficulty levels, flood-fill reveal and a safe first click. Open it in the browser and actually use it before you let the team go: agents verify their own code, but you own the acceptance test.

    Minesweeper game built by a Claude Code agent team running in the browser with Beginner, Intermediate and Expert difficulty buttons, an LCD mine counter and the smiley reset button
    The team's deliverable: a working Minesweeper clone.Watch at 9:00
  3. 10

    Iterate by prompting the same team

    The feature list checks out, so the video goes again: "Add more themes to it. Use team." For coding tasks the lead often keeps teammates idling instead of shutting them down, so your follow-up lands with full context of what was already built. Note the status bar: accept edits on (shift+tab to cycle).

    Claude Code terminal listing the Minesweeper features its agent team delivered, the open command for index.html, and the next iteration prompt Add more themes to it. Use team with accept edits on in the status bar
    The delivered feature list and the second-round prompt.Watch at 10:00
  4. 11

    Steer individuals from the teammates panel

    In a bigger team (the video's second demo runs six teammates), the panel shows each teammate's name, a live status word and its token count. shift+↑ / shift+↓ selects a teammate, Enter opens its transcript, and the message box accepts @-mentions like "Message @infra-dev…" to reach one teammate without going through the lead.

    Claude Code teammates panel listing six named teammates with live token counts and shift+up and shift+down to select, while the message box addresses the infra-dev teammate directly with an @-mention
    Six teammates, live token counts, and an @-mention message box.Watch at 13:30
  5. 12

    Shut teammates down gracefully

    Ask the lead by name — "Ask the ui-dev teammate to shut down" — and the teammate approves, finishing its current tool call first. A teammate that believes its work is mission-critical can reject the request with an explanation. When everything is done, "clean up the team" closes the shared sessions and the panes collapse back into one.

    Claude Code team lead cleanup showing the ui-dev and engine-dev teammates each shut down gracefully after the lead asks to clean up the team and release the shared sessions
    Both teammates shut down gracefully during cleanup.Watch at 8:00

4. Know the limits before you scale

  1. 13

    Know the context rule before you scale up

    Teammates load CLAUDE.md, MCP servers and skills automatically, but they never inherit the lead's conversation history. Hand context over explicitly — the docs' example spawns a security reviewer with the exact files, focus areas and reporting format in the prompt. And size tasks honestly: too small wastes coordination, too large risks wasted effort, just right is one self-contained deliverable.

    Claude Code Docs section Give teammates enough context explaining that teammates load CLAUDE.md, MCP servers and skills but never inherit the lead conversation history, above the Size tasks appropriately list of too small, too large and just right
    The context-inheritance rule and the task-sizing checklist.Watch at 10:15
  2. 14

    Accept that teams don't resume

    The limitation that surprises most people: /resume and /rewind do not restore in-process teammates. After resuming a session the lead may try to message teammates that no longer exist — when that happens, tell the lead to spawn new teammates. Also expect task status to lag: if a task looks stuck, check whether the work is actually done and update it manually.

    Claude Code Docs Limitations list highlighting that /resume and /rewind do not restore in-process teammates, plus task status lag, slow shutdowns, one team per session and no nested teams
    No session resumption, plus the task-status caveat.Watch at 10:30
  3. 15

    Check the remaining limitations, then pick real work

    Three more rules from the docs: the lead is fixed (you can't promote a teammate), permissions set at spawn propagate — --dangerously-skip-permissions flows to every teammate, so change a reviewer's mode afterwards if it shouldn't edit — and split panes require tmux or iTerm2, because VS Code's integrated terminal, Windows Terminal and Ghostty are unsupported. Then start with 3-5 teammates on genuinely collaborative work.

    Claude Code Docs Limitations section explaining that the lead is fixed, permissions set at spawn propagate to teammates, and split panes require tmux or iTerm2 because VS Code, Windows Terminal and Ghostty are unsupported
    Lead is fixed, permissions propagate, split panes need tmux.Watch at 11:30

Claude Code agent teams FAQ

Related guides