Day 38 of 52 · about 20 min · Subagents · Bonus
Try agent teams: sessions that coordinate
Subagents work for one session and report back to it. When parts of a job need to compare notes as they go, an agent team gives you several Claude sessions that message each other directly.
You’ll finish with
- Agent teams switched on in your user settings
- A three-teammate review of a real change
- A clear rule for team versus subagents
You’ll need
- Agent teams are experimental and off by default, and use significantly more tokens than a single session.
- A branch with changes to review, in any repository
Before you start
Tell us about your setup and the steps change to fit it. Your answers stay in this browser, and you can change them at any time.
Which system are you on?
Commands differ between systems. Pick the one you’ll run Claude Code on.
The steps
One step at a time. When a step’s check matches, tick it and the next one opens.
Step 1 of 4: Turn agent teams on
One environment variable in your user settings.Add it to the
envblock of your user settings, then start a new session. While it’s on, a subagent Claude names may start as a teammate instead.~/.claude/settings.json- env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: "1"
- Turns agent teams on for the sessions you start
The one setting agent teams need. Check it worked
Running
claude doctorin your terminal reports no invalid settings files.Step 2 of 4: Start a review team
Three teammates, three angles, no code changes.The docs suggest a first team that reviews or researches rather than writes code. Run this on your branch:
Paste into Claude CodeSpawn three teammates to review the changes on this branch against the default branch: - one focused on security - one checking performance - one checking test coverage Call them security, performance and tests. Have each report its findings, then combine them into one list, most serious first.In order:
You
You ask the lead
Claude
The lead spawns three teammates
Security, performance, tests
Claude
Each reviews from its angle
Claude
The lead combines the findings
How a team runs one review. Check it worked
Teammates appear in the agent panel below the prompt input. Subagents show there too, so if Claude used subagents, ask again for an agent team.
If it didn’t work
A teammate’s row disappeared.
Idle rows hide after 30 seconds. Message the teammate by name and its row comes back.
Step 3 of 4: Talk to a teammate directly
Select it in the agent panel and type.Use the arrow keys to select a teammate and press Enter to open its session. What you type goes to that teammate.
/clearand/compactstill act on the lead, so Claude Code asks first.In Claude CodeWhat happens: The security teammate is open.
You type: also check the new API route for missing auth
A message straight to one teammate. Check it worked
The teammate answers you in its own session.
Step 4 of 4: Decide when a team pays off
Teams cost more; subagents are often enough.Subagents
- Report back to the session that started them
- Lower token cost
- Best when only the result matters
Agent teams
- Message each other directly
- Higher token cost: each teammate is a separate Claude
- Best when the work needs discussion
Subagents versus agent teams, from the docs’ comparison. When you’re done, ask the lead to shut each teammate down, for example: “Ask the security teammate to shut down.”
Check it worked
You can name one task from your work that suits a team and one where subagents are enough.
Finish · 4 of 4 steps to go
You’ve run an agent team
0; saving applies it to the running session.What you’ll have checked
- The setting is in your user settings
- A team reviewed one change from three angles
- You messaged a teammate directly
Lesson updates by email
Get lesson updates by email
Leave your email and we’ll tell you when we add or update a lesson.
Claude Code for your team
Want Claude Code set up across your team?
HorizonLux sets up and repairs Claude Code for teams: CLAUDE.md rules, hooks that enforce them and reviewed MCP servers. Book a free call to talk it through.
Related
Questions
Questions about Day 38
Can I use agent teams with claude -p?
No. Teammates need an interactive session. In -p runs and Agent SDK sessions, Claude doesn’t spawn them.
Sources
Checked against the official Claude Code docs on .
Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.