/hub:spawn — Launch Parallel Agents
Launch N parallel subagents in isolated git worktrees to compete on the session task.
How to use it
Claude Code
- Run the line below. It pulls the whole folder into
~/.claude/skills/spawn, including the files SKILL.md points to. - Describe your job in plain words. Claude Code follows the skill from there.
npx degit alirezarezvani/claude-skills/engineering/agenthub/skills/spawn#main ~/.claude/skills/spawnFor one project only, change the path to .claude/skills/spawn. This skill also uses -result.md — copying SKILL.md alone won't be enough. See the folder on GitHub.
Claude (web or desktop app)
- On this page open ⋯ → Download .md.
- Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
- Pick the file and Save. Claude shows the name and description and runs a security scan.
- Check the skill is switched on.
- Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
- ChatGPT: make a Project and paste it into Instructions.
- Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
- Check which app you pasted it into — the steps above name the right one.
- Some skills need the paid tier of Claude or ChatGPT.
Paste into Claude, ChatGPT or Cursor.
Source of /hub:spawn — Launch Parallel Agents
Show the full text84 lines
| name | description | command |
|---|---|---|
| spawn | 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. | /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
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 |
Discussion
Browse more free Claude skills or everything in Development.