Skip to content
Skillpedia
Agents29k Β· #9535

spawn

What it does

This skill launches the parallel agents for a session that has already been set up. It is for people who want each agent to try a different strategy on the same task.

When to use it

  • βœ“When a session is set up and the agents are ready to start working.
  • βœ“When you want each agent to try a different strategy on the same task.
  • βœ“When you want the agents to follow an optimizer, refactorer, test writer or bug fixer pattern.

Skill link

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agenthub/skills/spawn/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agenthub/skills/spawn/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œLaunch the agents for the latest session using the refactorer template.”

5 new skills a week. 1 minute to read.

How it works

The agent loads the session settings and starts the agents with dispatch prompts, one per worktree. When a template is chosen, it uses that template's pattern and gives each agent a different strategy.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

/agenthub:spawn β€” Launch Parallel Agents

Spawn N subagents that work on the same task in parallel, each in an isolated git worktree.

Usage

/agenthub:spawn                                    # Spawn agents for the latest session
/agenthub:spawn 20260317-143022                    # Spawn agents for a specific session
/agenthub:spawn --template optimizer               # Use optimizer template for dispatch prompts
/agenthub: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

  1. Load session config from .agenthub/sessions/{session-id}/config.yaml
  2. For each agent 1..N:
    • Write task assignment to .agenthub/board/dispatch/
    • Build agent prompt with task, constraints, and board write instructions
  3. 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"
)
  1. Update session state to running via:
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-status
  • Evaluate when done with /agenthub:eval
FAQ

Why does each agent get a different strategy?

Different strategies explore more options in parallel, which makes the final comparison more useful.

Where do the agents work?

Each one works in its own isolated git worktree.

What templates can I use?

Optimizer, refactorer, test writer and bug fixer.

Details

Original description by the author

Use to launch the competing agents for an initialized AgentHub session in isolated worktrees.

repo: alirezarezvani/claude-skills

Popularity

GitHub stars
29k
Ranking position
#9535
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills