From claude-code
Claude Code agent teams — coordinate multiple independent Claude Code sessions working in parallel with shared task lists and inter-agent messaging. Use when the user asks to create a team, spawn teammates, coordinate parallel work, or describes work that benefits from parallel agents. Also triggers on TeamCreate, SendMessage, teammate mode, team lead, agent coordination, parallel sessions, or 'can we parallelize this with agents?'. Helps with planning parallel execution strategies and structuring team-based work.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code:agent-teams Describe the work to parallelize (e.g., 'review PR #42 for security and performance')Describe the work to parallelize (e.g., 'review PR #42 for security and performance')The summary Claude sees in its skill listing — used to decide when to auto-load this skill
```text
$ARGUMENTS
When the user invokes /agent-teams, design an agent team for their request.
If $ARGUMENTS is empty, ask the user what work they want to parallelize.
Follow the Team Design Workflow below to produce a ready-to-execute team plan, then offer to create the team.
When designing a team, follow these steps:
in-process (default, one terminal) or tmux (split panes, requires tmux/iTerm2).TeammateIdle, TaskCreated, or TaskCompleted hooks where appropriate.Present the team design as:
## Team: <team-name>
**Goal**: <one-sentence description>
### Teammates
| # | Name | Role | Owns | Model |
|---|------|------|------|-------|
| 1 | ... | ... | ... | ... |
### Dependency Order
<which teammate feeds into which>
### Prompt
<the natural-language prompt the user should give Claude to create this team>
### Configuration
<any settings needed — env vars, display mode, permissions>
See references/examples.rst for complete team configurations across common workflows.
Agent teams coordinate multiple independent Claude Code instances working in parallel. One session acts as the team lead, coordinating work, assigning tasks, and synthesizing results. Teammates work independently, each in its own context window, and communicate directly with each other.
This is fundamentally different from subagents. Read references/subagent-vs-team.rst for the full comparison — it matters because choosing the wrong one wastes tokens or limits capability.
Agent teams are experimental and disabled by default. Before using them:
Add to your project or user settings.json:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
Settings file locations (checked in this order):
<project>/.claude/settings.json<project>/.claude/settings.local.json~/.claude/settings.json~/.claude/settings.local.jsonRun the bundled config script:
# Check current status
bash scripts/check-config.sh
# Enable agent teams (writes to user settings)
bash scripts/check-config.sh --enable
# Disable agent teams
bash scripts/check-config.sh --disable
Teams add real value when:
Teams are NOT the right choice when:
Tell Claude what you want in natural language. Be specific about roles:
Create an agent team to review PR #142. Spawn three reviewers:
- One focused on security implications
- One checking performance impact
- One validating test coverage
Have them each review and report findings.
Claude handles TeamCreate, task list setup, and teammate spawning.
| Team size | Best for |
|---|---|
| 2-3 | Focused tasks: review, investigate, prototype |
| 4-5 | Complex features: frontend + backend + tests + docs |
| 6+ | Rarely justified — coordination overhead dominates |
Aim for 5-6 tasks per teammate to keep everyone productive. If you have 15 independent tasks, 3 teammates is a good starting point.
| Mode | Setting | When to use |
|---|---|---|
in-process | Default | All teammates in one terminal. Shift+Down to cycle. |
tmux | Requires tmux or iTerm2 | Each teammate gets its own pane. |
auto | Default behavior | Uses split panes if already in tmux, in-process otherwise. |
Set in ~/.claude.json:
{
"teammateMode": "in-process"
}
Or per-session: claude --teammate-mode in-process
Claude decides the number of teammates based on your task, or you can specify:
Create a team with 4 teammates to refactor these modules in parallel.
Use Sonnet for each teammate.
For risky changes, require teammates to plan before implementing:
Spawn an architect teammate to refactor the authentication module.
Require plan approval before they make any changes.
The lead reviews and approves/rejects plans autonomously. Influence judgment with criteria: "only approve plans that include test coverage."
Reference any subagent type (project, user, plugin, or CLI-defined) when spawning a teammate. The teammate inherits that subagent's system prompt, tools, and model:
Spawn a teammate using the security-reviewer agent type to audit the auth module.
The shared task list coordinates work. Tasks have three states:
pending -> in progress -> completed. Tasks can have dependencies —
a pending task with unresolved dependencies cannot be claimed.
The lead can assign tasks explicitly, or teammates can self-claim the next unassigned, unblocked task after finishing their current one. Task claiming uses file locking to prevent race conditions.
Three hooks enforce quality:
TeammateIdle: runs when a teammate is about to go idle. Exit code 2
sends feedback and keeps the teammate working.TaskCreated: runs when a task is being created. Exit code 2 prevents
creation and sends feedback.TaskCompleted: runs when a task is being marked complete. Exit code 2
prevents completion and sends feedback.Ask the researcher teammate to shut down
When done with the whole team:
Clean up the team
Always use the lead to clean up — teammates should not run cleanup.
| Component | Role |
|---|---|
| Team lead | Main session that creates the team, spawns teammates, coordinates |
| Teammates | Separate Claude Code instances working on assigned tasks |
| Task list | Shared work items at ~/.claude/tasks/{team-name}/ |
| Mailbox | Inter-agent messaging system |
Team config lives at ~/.claude/teams/{team-name}/config.json (auto-generated,
do not edit by hand — runtime state is overwritten on each update).
Teammates start with the lead's permission settings. Pre-approve common operations to reduce interruptions:
{
"permissions": {
"allow": [
"Read", "Glob", "Grep",
"Bash(git *)",
"Bash(npm test *)",
"Bash(go test *)"
]
}
}
Agent teams use significantly more tokens than a single session. Each teammate has its own context window, and usage scales linearly with active teammates. For research, review, and new feature work, the extra tokens are usually worthwhile. For routine tasks, a single session is more cost-effective.
| Issue | Fix |
|---|---|
| Teammates not appearing | Press Shift+Down to cycle; check task was complex enough |
| Too many permission prompts | Pre-approve common operations in permission settings |
| Teammates stopping on errors | Message them directly with additional instructions |
| Lead implements instead of delegating | Say "Wait for teammates to complete before proceeding" |
| Task status lagging | Check manually; tell lead to nudge the teammate |
| Orphaned tmux sessions | tmux ls then tmux kill-session -t <name> |
/resume won't restore them)| Command | Description |
|---|---|
bash scripts/check-config.sh | Check if agent teams are enabled |
bash scripts/check-config.sh --enable | Enable agent teams in user settings |
bash scripts/check-config.sh --disable | Disable agent teams in user settings |
npx claudepluginhub nq-rdl/agent-extensions --plugin claude-codeGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.