Launch N parallel subagents in isolated git worktrees
/hub:spawn — Launch Parallel Agents

Launch N parallel subagents in isolated git worktrees to compete on the session task. Use when the user runs /hub:spawn or asks to start the competing agents for an initialized AgentHub session.
--- name: "spawn" description: "Launch N parallel subagents in isolated git worktrees to compete on the session task. Use when the user runs /hub:spawn or asks to start the competing agents for an initialized AgentHub session." command: /hub:spawn --- # /hub:spawn — Launch Parallel Agents Spawn N subagents that work on the same task in parallel, each in an isolated git worktree. ## Usage ``` /hub:spawn # Spawn agents for the latest session /hub:spawn 20260317-143022 # Spawn agents for a specific session /hub:spawn --template optimizer # Use optimizer template for dispatch prompts /hub:spawn --template refactorer # Use refactorer template ```
Overview
Spawn N subagents that work on the same task in parallel, each in an isolated git worktree.
What you get
- Load session config from .agenthub/sessions/{session-id}/config.yaml
- For each agent 1..N:
- Write task assignment to .agenthub/board/dispatch/
- Build agent prompt with task, constraints, and board write instructions
- Launch ALL agents in a single message with multiple Agent tool calls:
- Update session state to running via:
Manual install (npx, ZIP)
npx skills add alirezarezvani/claude-skills --skill spawn -g -a claude-codemkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/alirezarezvani/claude-skills/tar.gz/19392f7a0826 \
| tar -xz -C ~/.claude/skills --strip-components=4 claude-skills-19392f7a0826/engineering/agenthub/skills/spawnNew-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/cdd1d08f59e1c5131ed9/spawn.zip" -OutFile "$env:TEMP\spawn.zip"; Expand-Archive "$env:TEMP\spawn.zip" -DestinationPath "$HOME\.claude\skills" -ForceConnects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md3.3 KB
Read the files here
alirezarezvani/
Shared references2SKILL.md reads these from elsewhere in the repo. Not in the ZIP.
- agent-templates.mdengineering/agenthub/skills/agenthub/references/7.6 KB
- session_manager.pyengineering/agenthub/skills/agenthub/scripts/9.8 KB
Show the full text84 lines
/hub:spawn — Launch Parallel Agents
Spawn N subagents that work on the same task in parallel, each in an isolated git worktree.
Usage
/hub:spawn # Spawn agents for the latest session
/hub:spawn 20260317-143022 # Spawn agents for a specific session
/hub:spawn --template optimizer # Use optimizer template for dispatch prompts
/hub:spawn --template refactorer # Use refactorer template
Templates
When --template <name> is provided, use the dispatch prompt from ../agenthub/references/agent-templates.md instead of the default prompt below. Available templates:
| Template | Pattern | Use Case |
|---|---|---|
optimizer |
Edit → eval → keep/discard → repeat x10 | Performance, latency, size reduction |
refactorer |
Restructure → test → iterate until green | Code quality, tech debt |
test-writer |
Write tests → measure coverage → repeat | Test coverage gaps |
bug-fixer |
Reproduce → diagnose → fix → verify | Bug fix with competing approaches |
When using a template, replace all {variables} with values from the session config. Assign each agent a different strategy appropriate to the template and task — diverse strategies maximize the value of parallel exploration.
What It Does
- Load session config from
.agenthub/sessions/{session-id}/config.yaml - For each agent 1..N:
- Write task assignment to
.agenthub/board/dispatch/ - Build agent prompt with task, constraints, and board write instructions
- Write task assignment to
- Launch ALL agents in a single message with multiple Agent tool calls:
Agent(
prompt: "You are agent-{i} in hub session {session-id}.
Your task: {task}
Read your full assignment at .agenthub/board/dispatch/{seq}-agent-{i}.md
Instructions:
1. Work in your worktree — make changes, run tests, iterate
2. Commit all changes with descriptive messages
3. Write your result summary to .agenthub/board/results/agent-{i}-result.md
Include: approach taken, files changed, metric if available, confidence level
4. Exit when done
Constraints:
- Do NOT read or modify other agents' work
- Do NOT access .agenthub/board/results/ for other agents
- Commit early and often with descriptive messages
- If you hit a dead end, commit what you have and explain in your result",
isolation: "worktree"
)
- Update session state to
runningvia:
python {skill_path}/scripts/session_manager.py --update {session-id} --state running
Critical Rules
- All agents in ONE message — spawn all Agent tool calls simultaneously for true parallelism
- isolation: "worktree" is mandatory — each agent needs its own filesystem
- Never modify session config after spawn — agents rely on stable configuration
- Each agent gets a unique board post — dispatch posts are numbered sequentially
After Spawn
Tell the user:
- {N} agents launched in parallel
- Each working in an isolated worktree
- Monitor with
/hub:hub-status - Evaluate when done with
/hub:eval
| 1 | |
| 2 | name "spawn" |
| 3 | description "Launch N parallel subagents in isolated git worktrees to compete on the session task. Use when the user runs /hub:spawn or asks to start the competing agents for an initialized AgentHub session." |
| 4 | command /hub:spawn |
| 5 | |
| 6 | |
| 7 | # /hub:spawn — Launch Parallel Agents |
| 8 | |
| 9 | Spawn N subagents that work on the same task in parallel, each in an isolated git worktree. |
| 10 | |
| 11 | ## Usage |
| 12 | |
| 13 | |
| 14 | /hub:spawn # Spawn agents for the latest session |
| 15 | /hub:spawn 20260317-143022 # Spawn agents for a specific session |
| 16 | /hub:spawn --template optimizer # Use optimizer template for dispatch prompts |
| 17 | /hub:spawn --template refactorer # Use refactorer template |
| 18 | |
| 19 | |
| 20 | ## Templates |
| 21 | |
| 22 | When `--template <name>` is provided, use the dispatch prompt from `../agenthub/references/agent-templates.md` instead of the default prompt below. Available templates: |
| 23 | |
| 24 | | Template | Pattern | Use Case | |
| 25 | |----------|---------|----------| |
| 26 | | `optimizer` | Edit → eval → keep/discard → repeat x10 | Performance, latency, size reduction | |
| 27 | | `refactorer` | Restructure → test → iterate until green | Code quality, tech debt | |
| 28 | | `test-writer` | Write tests → measure coverage → repeat | Test coverage gaps | |
| 29 | | `bug-fixer` | Reproduce → diagnose → fix → verify | Bug fix with competing approaches | |
| 30 | |
| 31 | When using a template, replace all `{variables}` with values from the session config. Assign each agent a **different strategy** appropriate to the template and task — diverse strategies maximize the value of parallel exploration. |
| 32 | |
| 33 | ## What It Does |
| 34 | |
| 35 | Load session config from `.agenthub/sessions/{session-id}/config.yaml` |
| 36 | For each agent 1..N: |
| 37 | Write task assignment to `.agenthub/board/dispatch/` |
| 38 | Build agent prompt with task, constraints, and board write instructions |
| 39 | Launch ALL agents in a **single message** with multiple Agent tool calls: |
| 40 | |
| 41 | |
| 42 | Agent( |
| 43 | prompt: "You are agent-{i} in hub session {session-id}. |
| 44 | |
| 45 | Your task: {task} |
| 46 | |
| 47 | Read your full assignment at .agenthub/board/dispatch/{seq}-agent-{i}.md |
| 48 | |
| 49 | Instructions: |
| 50 | 1. Work in your worktree — make changes, run tests, iterate |
| 51 | 2. Commit all changes with descriptive messages |
| 52 | 3. Write your result summary to .agenthub/board/results/agent-{i}-result.md |
| 53 | Include: approach taken, files changed, metric if available, confidence level |
| 54 | 4. Exit when done |
| 55 | |
| 56 | Constraints: |
| 57 | - Do NOT read or modify other agents' work |
| 58 | - Do NOT access .agenthub/board/results/ for other agents |
| 59 | - Commit early and often with descriptive messages |
| 60 | - If you hit a dead end, commit what you have and explain in your result", |
| 61 | isolation: "worktree" |
| 62 | ) |
| 63 | |
| 64 | |
| 65 | Update session state to `running` via: |
| 66 | |
| 67 | python {skill_path}/scripts/session_manager.py --update {session-id} --state running |
| 68 | |
| 69 | |
| 70 | ## Critical Rules |
| 71 | |
| 72 | **All agents in ONE message** — spawn all Agent tool calls simultaneously for true parallelism |
| 73 | **isolation: "worktree"** is mandatory — each agent needs its own filesystem |
| 74 | **Never modify session config** after spawn — agents rely on stable configuration |
| 75 | **Each agent gets a unique board post** — dispatch posts are numbered sequentially |
| 76 | |
| 77 | ## After Spawn |
| 78 | |
| 79 | Tell the user: |
| 80 | {N} agents launched in parallel |
| 81 | Each working in an isolated worktree |
| 82 | Monitor with `/hub:hub-status` |
| 83 | Evaluate when done with `/hub:eval` |
| 84 |
Details
- Updated
- Aug 30, 2026
- License
- MIT
- Stars on the repo
- ★ 26,349
- Checked
- Source
- alirezarezvani/claude-skills ↗
- Creator
- alirezarezvani · 363 listings
Similar skills
See all →
SkillTests in real browsers via Chrome DevTools MCPBrowser testing with devtools
MCPThis MCP server attempts to exercise all the featuresEverything MCP Server
MCPA Model Context Protocol server that provides web contentFetch MCP Server
MCPNode.js server implementing Model Context ProtocolFilesystem MCP Server
SkillAbout libraries, frameworks, API referencesContext7 MCP
SkillUses Chrome DevTools via MCP for efficient debuggingMore from alirezarezvani
SkillResume a paused experiment/ar:ar-resume — Resume Experiment
SkillShow experiment dashboard with results, active loops/ar:ar-status — Experiment Dashboard
SkillStart an autonomous experiment loop with user-selected/ar:loop — Autonomous Experiment Loop
SkillRun a single experiment iteration/ar:run — Single Experiment Iteration
SkillSet up a new autoresearch experiment interactively/ar:setup — Create New Experiment
Skill/cs:boardroom <brief/cs:boardroom — Multi-Role Boardroom Deliberation