Claude Code agent teams: subagents, teammates, parallel sessions and hand-offs

Five ways to make several Claude Code agents work together, from subagents and the experimental agent teams to worktree sessions, scripts and agents that hand work to each other, with what each one does well and what it costs.

· 6 min read

"Several agents working together" covers five different setups in Claude Code, and they solve different problems. A subagent goes off, does one job and reports back. An agent team is a lead with teammates who message each other and share a task list. Parallel sessions are you running several Claudes at once, each on its own branch. Scripts chain Claude runs without anyone watching. And long-lived agents, each with a role, can hand work to each other over hours or days. This page explains each one, from Anthropic's docs as of November 27, 2026, and when to pick it.

#Which approach fits which job?

Who coordinatesAgents talk to each otherLastsBest for
SubagentsThe main sessionNo, they report backOne taskSearches, reviews, verbose work
Agent teamsA lead sessionYes, by messageOne sessionA problem worth several angles at once
Parallel sessionsYouNoUntil you mergeIndependent features on separate branches
Scripts (claude -p, Agent SDK)Your codeThrough your codeOne runPipelines, CI, batch jobs
Agents that hand offEach agent, or a managerYes, by handing work overDays, weeksWork with roles beyond one coding task

#Subagents: delegate and get a summary back

A subagent is a second Claude with its own context window, its own instructions and its own tools. The main session hands it a job, it does the noisy part (forty files read, a long log), and only its summary comes back. You define one as a Markdown file in .claude/agents/; Claude Code also has built-in ones such as Explore and Plan. Several can run at once (up to 20 by default), and each can work in its own worktree with isolation: worktree.

What it does well: keeps your main conversation short, runs independent investigations in parallel, reviews code without the bias of having written it.

Where it stops: subagents don't talk to each other or to you while they work. They see only the prompt Claude wrote them, not your conversation. If the job needs back-and-forth, it's the wrong tool.

The full guide, with an agent file to copy: Subagents in Claude Code.

#Agent teams: a lead and teammates who message each other

Agent teams are Claude Code's own feature for this, and they're experimental and off by default. Turn them on with an environment variable, in your shell or in settings.json under env:

export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

Then ask for a team in plain words ("spin up three teammates: one on the API, one on the UI, one writing tests"). According to the agent teams page:

  • The lead is your session. Teammates are separate Claude Code instances, each with its own context.
  • A shared task list (in ~/.claude/tasks/) holds the work, with locking so two teammates don't take the same task.
  • Teammates message each other by name, and you can message any of them directly. An idle teammate tells the lead.
  • Display: in-process by default, in any terminal; or one pane per teammate with tmux or iTerm2 (teammateMode).

What it does well: problems that benefit from several angles at once and some debate: a bug with three plausible causes, a design reviewed from security, performance and API sides, a feature split cleanly by file.

Where it stops (from the docs' own list):

  • Interactive sessions only: claude -p and the Agent SDK don't spawn teammates.
  • One team per session, no nested teams, and the lead can't change.
  • /resume and /rewind don't bring in-process teammates back.
  • Teammates aren't put in worktrees, so split the work by file or they'll edit the same ones.
  • Task status can lag, and shutting a team down can be slow.

Cost: every teammate is a full Claude Code session. Anthropic's costs page says a team in plan mode uses about 7 times the tokens of a standard session, and suggests 3 to 5 teammates and Sonnet for them. On a Pro or Max plan, that's your usage limits going 7 times as fast.

#Parallel sessions: you are the lead

The oldest way, and still the most predictable: open several Claude Code sessions, each on its own task, each in its own checkout.

claude --worktree invoices    # its own branch and folder under .claude/worktrees/
claude --worktree invites

Nothing is shared but the repository, so nothing collides until you merge. Claude Code also has background sessions in research preview: claude --bg "task" starts one, and claude agents lists them all. For a large mechanical change, /batch splits it across many subagents, each in its own worktree.

What it does well: independent features, predictable cost (one session each), full control over what gets merged.

Where it stops: the agents don't know about each other. Coordination is your job, and past four or five sessions the hard part is knowing which one is waiting for you. More in running several Claude Code sessions at once and git worktrees with Claude Code.

#Scripts: claude -p and the Agent SDK

When the steps are known in advance, write them down. claude -p "…" runs one task without a conversation and prints the result (--output-format json for something a script can read), and --resume <id> continues a run. Chain them in a shell script or a CI job: one run finds the failing tests, the next fixes each, a third reviews the diff. The Agent SDK does the same from TypeScript or Python, with subagents.

What it does well: repeatable pipelines, CI, overnight batches.

Where it stops: it does exactly what you wrote. Anything unexpected ends the run or goes wrong quietly, so check the output. Note that the Agent SDK's docs ask third-party products to use an API key, not a claude.ai login. See Claude Code headless mode.

#Agents that hand work to each other

The four setups above live inside one coding task. A different kind of team lasts longer: agents with a role each (Marketing, Support, a changelog writer) that keep their memory, run on a schedule and pass work along. Claude ships a feature, the changelog agent writes the notes, Marketing drafts the post, and what only you can decide waits for you.

What makes this work is the same as with people: one job per agent, a place to hand work over, and a rule for what needs a yes. We wrote about it in running AI agents like a small company.

What it does well: work that spans days and goes beyond code: support mail, posts, numbers, follow-ups.

Where it stops: it's slower than a team inside one session, and each agent's job has to be written down clearly, or they drift.

#In Relais

Relais covers the last three. Parallel sessions: every Claude Code session sits under its project, with an orange dot when one waits for you; "Own worktree and branch" gives a session its own checkout, merged back from its header. Subagents and background commands show in a Tasks tab with their live output and a stop button. Agents that hand off: you text agents like teammates, each with its role, routines and its own browser. They hand work straight into each other's conversation, a routine can start when another agent finishes, and your personal assistant routes jobs to the right agent and briefs you when your day starts. Deploys, money and anything sent out wait for your OK. See agents and routines.

Relais runs Claude Code through the Agent SDK, so Claude Code's experimental agent teams don't start inside Relais sessions. Run them in a terminal.

Your AI team,
on your Claude plan.

$14.99 a month, everything included. On your Mac or on Linux, on your Claude Pro or Max plan. Cancel any time.