No slash command · from agent-patterns-plugin
Configures Claude Code agent teams for parallel agent coordination using SendMessage and TaskUpdate. Use when running multiple agents concurrently with messaging or lead/teammate architecture.
Ships in agent-patterns-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Experimental: Agent teams require
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1and may change between Claude Code versions.
BREAKING (Claude Code 2.1.178): The explicit
TeamCreate/TeamDeletetools were removed. Every session now has one implicit team whenCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1is set — there is nothing to create or tear down. Theteam_nameparameter is still accepted but ignored on the tools that took it (e.g.Agent), so older invocations don't error; omit it in new code. Coordination is otherwise unchanged: spawn teammates with theAgenttool, coordinate withSendMessage, and track work withTaskCreate/TaskList/TaskUpdate.
Task tools are opt-in on current models (Claude Code 2.1.233+).
TaskCreate/TaskGet/TaskUpdate/TaskList/TodoWriteare not exposed on Opus 4.8, Sonnet 5, Fable 5 / 5.1, Mythos 5 or newer unless the session opted in — see.claude/rules/agentic-permissions.md§ "Standard Permission Sets" → "Task-tool availability" for the three opt-ins and the full semantics. On a session without one, a lead cannot create or assign shared tasks: set the variable, or coordinate viaSendMessagealone and carry the task list in the lead's own message to each teammate. CheckTaskListis callable before spawning teammates.
For the worked setup examples, communication snippets, shutdown procedures, the worktree path-resolution recovery routine, and common dispatch patterns, see REFERENCE.md.
| Use agent teams when... | Use subagents instead when... |
|---|---|
| Multiple agents need to work in parallel | Tasks are sequential and interdependent |
| Ongoing communication between agents is needed | One focused task produces one result |
| Background tasks need progress reporting | Agent output feeds directly into next step |
| Complex workflows benefit from task coordination | Simple, bounded, isolated execution |
| Independent changes to the same codebase (with worktrees) | Context sharing is fine and efficient |
Agent and the related parallel-spawn tools may not be present in a
sub-agent's tool surface, even if the parent conversation has them. A
sub-agent designed to orchestrate its own team can silently degrade to sequential
single-thread execution — same content, ~5× longer wall-clock — without surfacing
the failure until its post-completion summary.
| Situation | Recommended pattern |
|---|---|
| Fan-out from the main conversation | Spawn parallel Agent calls directly — full tool surface available |
| Sub-agent orchestrating its own team | Avoid by design: split the work so the main thread does the fan-out |
| Sub-agent must orchestrate a team | Detect tool availability up front; report sequential fallback as a first-class outcome |
Detection contract to brief into a coordinating sub-agent: confirm the
Agent tool is callable; if not, do not silently fall back — report
"Parallel fan-out unavailable in this sandbox; executed sequentially." as the
first line of the summary, then continue sequentially with the same input
contract. Plan top-level orchestration in the main conversation when you can.
The implicit team (2.1.178) needs no create/delete step — these tools operate on the one team the session already has:
| Tool | Purpose |
|---|---|
Agent | Spawn a teammate (give it a name; team_name is accepted but ignored) |
SendMessage | Send DMs, broadcasts, shutdown requests, plan approvals |
TaskCreate / TaskList / TaskUpdate | Create, discover, and assign/advance shared tasks |
Read | Get a background agent's output from the file path its spawn result names (TaskOutput was removed in 2.1.277) |
TaskStop | Stop a running background agent |
ListAgents | Discover teammates and other sessions reachable via SendMessage |
The setup sequence — TaskCreate → spawn teammates via the Agent tool (with a
name) → TaskUpdate to assign → receive results automatically — is shown with
full code in REFERENCE.md → Team setup workflow.
Teammate messages are delivered to the lead's inbox between turns; no polling needed.
| State | Meaning |
|---|---|
pending | Not yet started |
in_progress | Assigned and active (one at a time per teammate) |
completed | Finished successfully |
blocked | Waiting on another task (blocked_by field) |
Teammates claim tasks in ID order (lowest first) via TaskList +
TaskUpdate, and skip blocked tasks until their blocker completes.
| Type | Use When |
|---|---|
message | Direct message to a specific teammate (recipient = name, not agentId) |
broadcast | Critical team-wide announcement (N teammates = N round-trips — use sparingly) |
shutdown_request / shutdown_response | Graceful teammate exit handshake |
plan_approval_response | Approve or reject a teammate's plan |
DM, broadcast, and discovery (address by spawn-time name; enumerate with
ListAgents) examples are in
REFERENCE.md → Communication.
in_progress at a time.TaskUpdate (not SendMessage) to report task completion.SendMessage — plain text output is NOT visible to the lead.recipient.Before drafting the PRP and launching agents, run the 30-second sweep in references/lead-preflight.md: next ADR/PRD/PRP number, filename conflicts, hardware pin budget.
Include the out-of-scope discovery protocol in every agent's prompt when that
agent has an exclusive write scope — it prevents the "investigate out of scope →
exhaust budget → truncated summary" failure mode. Copy the verbatim block from
REFERENCE.md → Out-of-scope discovery protocol:
the agent stops immediately on an out-of-scope dependency, lists it under an
Out-of-scope dependencies summary section, and exits for the lead to triage.
Worktree-isolated agents can have Edit/Write silently resolve relative paths
against the parent repo instead of their worktree (upstream bug
#1091), landing
commits on the wrong branch with no immediate signal. Harden every
worktree-isolated prompt with the absolute-path preamble, run the lead
post-flight check (git diff origin/main..HEAD + git status --porcelain from
the parent), and use the cherry-pick + rebase recovery — all in
REFERENCE.md → Worktree path resolution.
See also .claude/rules/agent-coworker-detection.md.
SendMessage-resume of a completed worktree-isolated agent (Agent with isolation: "worktree") re-enters its worktree only if the worktree was kept, which happens when the agent left changes in it. A worktree with no changes is removed when the agent completes, and the resumed run then executes in the orchestrator's main checkout and loses worktree isolation. Check git worktree list before resuming a file-mutating agent; re-dispatch a fresh isolation: "worktree" agent when its worktree is gone. See parallel-agent-dispatch → "Resuming agents: SendMessage re-enters only a kept worktree" (issues #1546, #2330).
In web sessions (CLAUDE_CODE_REMOTE=true) the lead does every push/PR: see references/web-sandbox.md.
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 set (the implicit team exists; no create step).claude/rules/agentic-permissions.md § "Task-tool availability"); verify TaskList is callable before the first TaskCreateTaskCreate for each work unitAgent tool with a name (no team_name needed)TaskUpdate to assign tasks (or let teammates self-assign)SendMessageSendMessage shutdown_request to each teammate when done (no TeamDelete)On-disk team/task state and the common setup mistakes: references/troubleshooting.md.
parallel-agent-dispatch — worktree preflight, scope budgets, and the Return Contract every teammate must emit on exit. Team dispatches are a superset of plain parallel fan-out; follow both..claude/rules/agent-development.md — agent file structure, model selection.claude/rules/agent-runtime.md — worktree isolation, background execution.claude/rules/agentic-permissions.md — granular tool permission patterns.claude/rules/sandbox-guidance.md — web sandbox constraints and push delegationWhat SKILL.md sets; muted values are Claude Code's defaults
opusThree short reads, in order
npx claudepluginhub laurigates/claude-plugins --plugin agent-patterns-plugin26 skills in this plugin
/adversarial-reviewAdversarial second-pass review that tries to break code, designs, plans, or ADRs. Use when stakes are high and a normal review already ran./agent-cli-worktree-safetyData-loss invariants for a CLI that runs an agent SDK in a git worktree then force-removes it. Use when building or reviewing such a CLI, or when an agent run reports "no changes" after writing files./agy-headlessDrive Antigravity CLI (agy) from Claude Code — headless prompts with JSON results, or a tmux-hosted TUI. Use when delegating a task to agy or reading an open agy session./cold-read-gateGate outward-bound text (upstream issues, docs, PR bodies) through isolated haiku fresh-reader critique before publishing. Use when an artifact must survive a reader with zero project context./custom-agent-definitionsWrite and configure custom agent definitions in Claude Code agents/ directory. Use when creating an agent .md file, defining a specialized agent, or configuring agent tools./exclusive-lock-dispatchPre-dump-then-dispatch for tools holding an exclusive lock (Ghidra, migrations, single-writer caches). Use when fanning out parallel agents needing a non-concurrent resource.Other plugins' skills for the same job