SkillsApr 8, 2026·3 min read

Claude Code Swarm Orchestration Skill Guide

Complete reference skill for multi-agent swarm orchestration in Claude Code. Covers TeammateTool API, 6 orchestration patterns, spawn backends, and error handling.

Agent ready

Review-first install path

This asset needs a review step. The copied prompt tells the agent to dry-run, show the writes, then proceed only after confirmation.

Needs Confirmation · 64/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Claude Code Swarm Orchestration Skill Guide
Review-first command
npx -y tokrepo@latest install e07746ff-7065-4e96-922d-9c02aa90f6a8 --target codex

Dry-run first, confirm the writes, then run this command.

TL;DR
A skill that teaches Claude Code to orchestrate multi-agent swarms using TeammateTool, spawn patterns, and error handling.
§01

What it is

The Swarm Orchestration skill is a reference guide for building multi-agent systems within Claude Code. It documents the TeammateTool API for spawning subagents, six orchestration patterns (fan-out, pipeline, supervisor, consensus, map-reduce, and recursive), spawn backend options, and error handling strategies. The skill file is installed into your Claude Code skills directory and activates when you work on multi-agent workflows.

This skill targets developers building complex AI systems where a single agent is insufficient -- scenarios requiring parallel research, multi-step validation, or coordinated code changes across a large codebase.

§02

How it saves time or tokens

Without this skill, developers must discover the TeammateTool API and orchestration patterns through trial and error. The skill provides tested patterns with correct parameter names, error handling, and concurrency limits. This means Claude Code generates working multi-agent code on the first attempt rather than producing broken spawn calls that fail at runtime.

§03

How to use

  1. Save the skill file to your Claude Code skills directory:
mkdir -p ~/.claude/skills/swarm-orchestration
curl -o ~/.claude/skills/swarm-orchestration/SKILL.md \
  https://gist.githubusercontent.com/kieranklaassen/4f2aba89594a4aea4ad64d753984b2ea/raw/SKILL.md
  1. Or install via Claude Code:
claude skill install swarm-orchestration
  1. Ask Claude Code to build multi-agent workflows -- it will automatically reference the skill patterns.
§04

Example

# Fan-out pattern: parallel research agents
from claude_code import TeammateTool

# Spawn 3 research agents in parallel
tasks = [
    TeammateTool.spawn(
        name='researcher-1',
        prompt='Research React state management libraries',
        background=True
    ),
    TeammateTool.spawn(
        name='researcher-2',
        prompt='Research Vue state management libraries',
        background=True
    ),
    TeammateTool.spawn(
        name='researcher-3',
        prompt='Research Svelte state management libraries',
        background=True
    ),
]

# Collect results
results = [task.wait() for task in tasks]

# Synthesize findings
TeammateTool.spawn(
    name='synthesizer',
    prompt=f'Compare these findings: {results}'
)
§05

Related on TokRepo

§06

Common pitfalls

  • Spawning too many concurrent agents exhausts API rate limits; the skill recommends a maximum of 5 parallel spawns
  • Subagent errors do not propagate to the parent by default; always check return status before using results
  • The skill file must be in the correct directory structure (~/.claude/skills/<name>/SKILL.md) or Claude Code will not detect it

Frequently Asked Questions

What orchestration patterns does the skill cover?+

The skill documents six patterns: fan-out (parallel independent tasks), pipeline (sequential handoffs), supervisor (parent monitors children), consensus (multiple agents vote on output), map-reduce (split work then aggregate), and recursive (agent spawns sub-problems of the same type).

What is TeammateTool?+

TeammateTool is the Claude Code API for spawning subagents. It lets one Claude Code session create child sessions with specific prompts, tools, and permissions. Each child runs independently and returns results to the parent. The skill documents the correct parameters and patterns.

How many agents can run in parallel?+

The practical limit depends on your API rate limits and the complexity of each agent's task. The skill recommends a maximum of 5 parallel spawns to avoid rate limiting. For larger workloads, use a pipeline or map-reduce pattern with controlled concurrency.

Does this skill work with any Claude Code version?+

The skill requires a Claude Code version that supports TeammateTool and the skills directory structure. Check that your Claude Code version supports subagent spawning before installing. Older versions without TeammateTool will not benefit from the skill.

Can I customize the orchestration patterns?+

Yes. The skill provides reference patterns that you can modify. Each pattern is a starting point. You can adjust concurrency limits, error handling strategies, and result aggregation logic to match your specific use case.

Citations (3)
🙏

Source & Thanks

Created by Kieran Klaassen. Based on Claude Code v2.1.19.

Original Gist

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets