---
title: "#25: Agent Teams"
description: "Agent teams, an experimental way to have several Claude Code sessions work on one problem together. One session acts as the team lead."
url: https://littlecupsofclaude.com/25
date: 2026-11-27
author: Jake Marsh
topics: ["Workflows", "Claude Code CLI"]
---

# #25: Agent Teams 👥

> Agent teams, an experimental way to have several Claude Code sessions work on one problem together. One session acts as the team lead.

Published 2026-11-27 by Jake Marsh on Little Cups of Claude. Canonical: https://littlecupsofclaude.com/25
Topics: [Workflows](https://littlecupsofclaude.com/topics/workflows), [Claude Code CLI](https://littlecupsofclaude.com/topics/claude-code-cli)

Today we'll check out **agent teams**, an experimental way to have several **Claude Code** sessions work on one problem together.

One session acts as the team lead. It splits up the work, assigns tasks, and pulls the results together, while each teammate works in its own context window and can message the others directly. Let's take a look.

## Turning It On

**Agent teams** are off by default. We enable them with an environment variable, either in our shell or in settings:

```settings.json
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}
```

Teams need an interactive session. In `-p` mode and the **Agent SDK**, **Claude** doesn't spawn teammates.

## Teams vs Subagents

Both run work in parallel, but they're shaped differently. A subagent does a focused job and reports its result back to whoever started it. Teammates share a task list, claim work, and talk to each other without going through the lead.

That makes teams a good fit when the workers need to share findings and push back on each other. When only the result matters, subagents are cheaper, since each teammate is a whole separate **Claude** instance.

## Starting A Team

We describe the task and the teammates we want in plain language:

```text
We're designing a CLI that tracks TODO comments across a codebase.
Spawn three teammates to explore it: one on UX, one on the
technical architecture, and one playing devil's advocate.
```

We can be specific about size and model too:

```text
Spawn 4 teammates to refactor these modules in parallel.
Use Sonnet for each teammate.
```

If **Claude** reaches for subagents instead, we just ask again and request an agent team by name.

## Talking To Teammates

Teammates show up in a panel under the prompt. Arrow keys pick one, `Enter` opens its transcript so we can message it directly, `x` stops it, and `Ctrl+T` toggles the shared task list.

For everyone on screen at once, split panes give each teammate its own pane (this needs **tmux** or **iTerm2**):

```settings.json
{
  "teammateMode": "auto"
}
```

When a teammate is done, we ask the lead to shut it down by name, like `Ask the researcher teammate to shut down`. Neat!

## Quality Gates

Hooks can keep the team honest. `TeammateIdle` runs when a teammate's about to go idle, and `TaskCompleted` runs when a task is being marked done. Exiting with code `2` from either sends feedback and keeps the work going:

```bash
#!/bin/bash
# task-completed.sh
bun test > /dev/null 2>&1 || { echo "Tests are failing, keep going" >&2; exit 2; }
```

## Watch Out

A few rough edges to know about:

- Token use scales with the number of teammates. Starting with around ~3-5 is a good default.
- Two teammates editing the same file means overwrites, so each one should own its own set of files.
- `/resume` and `/rewind` don't restore in-process teammates, so the lead may need to spawn fresh ones.
- Teammates can't spawn teammates of their own, and a session has exactly one team.

Research and review jobs (a PR review, a bug investigation) are a nice way to start, since they show off the parallel exploration without the coordination headaches of parallel coding.

More info about **agent teams** can be found at [the Claude Code docs](https://code.claude.com/docs/en/agent-teams).
