Lesson 0003

Work with an agent team without losing control

Agent teams are for work where several Claude Code sessions need separate context, clear ownership, and direct communication. Your job is to give the lead a crisp brief, name the teammates, set boundaries, and wait for the team to converge.

Mission extension: Claude Code Agents View Previous: Inspect a Git worktree Reference: agent teams quick reference Source: official Claude Code docs

The one idea

Use an agent team when parallel discussion changes the quality of the answer. A team has one lead session, separate teammate sessions, a shared task list, and direct teammate messaging. This is heavier than a normal session or a subagent, so start with review, research, or competing hypotheses before asking multiple teammates to edit code.

Version and feature check: agent teams are experimental and disabled by default. The official docs describe the current flow as of Claude Code v2.1.178 and newer, with behavior updates through later 2.1.x versions. Check claude --version and enable CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS before relying on this workflow.

Enable the feature

Put the environment variable in Claude Code settings when you want the feature available across sessions:

{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

The default display mode is in-process, which keeps teammates inside the main terminal. Split panes are optional and require tmux or iTerm2 setup.

The control loop

QualifyDoes parallel work help? NameGive stable teammate names BoundAssign files, risks, or lenses MonitorUse the agent panel SteerMessage a teammate directly SynthesizeWait, compare, decide

The key move is naming teammates and giving each one a different lens. Names make follow-up prompts precise. Boundaries reduce overlap, file conflicts, and duplicated investigation.

Your first safe team

  1. Start with read-only work

    Use a review or research task first. This teaches coordination without mixing parallel edits, permission prompts, and merge cleanup.

  2. Spawn named teammates

    Give the lead the task, the teammate names, and the boundaries in one prompt:

    I want to evaluate whether this repository needs dependency cleanup.
    Spawn three teammates named mapper, risk, and verifier.
    
    mapper: inspect package structure, scripts, and dependency surfaces.
    risk: look for upgrade, security, or compatibility risks.
    verifier: find the safest commands to verify changes later.
    
    Do not edit files. Have teammates share findings with each other,
    challenge weak assumptions, and wait until all three are done.
    Then synthesize a short plan with clear next steps.
  3. Watch the agent panel

    In in-process mode, use Up and Down to select a teammate and Enter to view its transcript. Press Esc to interrupt a selected teammate's current turn if it is going off track.

  4. Steer by name

    Message one teammate directly when the correction is local: Ask verifier to include commands that do not require network access. Send one message per teammate when everyone needs the same new constraint.

  5. Wait before acting

    If the lead starts implementing before teammates finish, tell it: Wait for your teammates to complete their tasks before proceeding. A team is only worth the overhead if you let the independent work land before synthesis.

  6. Shut down cleanly

    When a named teammate is no longer needed, ask the lead to shut it down: Ask the risk teammate to shut down.

Use the right delegation tool

Need Use Why
One linear task with normal context. Single session Lowest coordination cost.
A focused helper where only the result matters. Subagent Parallel work reports back to the caller.
Several perspectives need to compare notes. Agent team Teammates can communicate directly and coordinate through tasks.
Several independent coding branches must stay isolated. Worktrees or Agents View Separate working directories reduce file conflicts.

Safety rules

Practice: retrieve the control points

Type the missing command, setting, or phrase from memory. These checks focus on the parts that keep a team easy to steer.

Primary source

Ask follow-up questions: Bring this lesson back to the agent if you want to design a team prompt for a real repo, compare agent teams with subagents, or plan file boundaries before allowing teammates to edit.