/install claude-swarm
Claude Swarm — Multi-Agent Orchestration
Parallel Claude Code agents: plan → endorse → spawn → monitor → review → integrate → ship.
Quick Start
# 1. Write task prompts
cat > /tmp/prompt-task1.md \x3C\x3C 'EOF'
Implement feature X...
EOF
# 2. Create tasks JSON
cat > /tmp/tasks.json \x3C\x3C 'EOF'
[
{"id": "feat-x", "description": "/tmp/prompt-task1.md", "role": "builder"},
{"id": "feat-y", "description": "/tmp/prompt-task2.md", "role": "builder"}
]
EOF
# 3. Spawn batch (auto-endorses + auto-integration)
bash scripts/spawn-batch.sh "/path/to/project" "batch-1" "Description" /tmp/tasks.json
Roles & Models
| Role | Model | Effort | Use |
|---|---|---|---|
| architect | opus | high | Design, planning, complex decisions |
| builder | sonnet | high | Feature implementation (parallel) |
| reviewer | sonnet | medium | Auto-review on completion |
| integrator | opus | high | Cross-branch merge + conflict resolution |
Configure in config/duty-table.json.
Scripts
| Script | Purpose |
|---|---|
spawn-batch.sh |
Spawn N parallel agents + integration watcher |
spawn-agent.sh |
Spawn single agent in worktree + tmux |
endorse-task.sh |
Endorse task (required before spawn) |
check-agents.sh |
Show status of all running agents |
cleanup.sh |
Remove worktrees, branches, tmux sessions |
notify.sh |
Send webhook/Telegram notification |
notify-on-complete.sh |
Auto-watcher: notify + review on completion |
integration-watcher.sh |
Auto: merge all branches when batch completes |
Workflow Detail
1. Planning (human + architect)
Break work into parallel tasks. Each task needs: ID, prompt, role.
2. Endorsement Gate
Every task requires endorsement before spawning — safety gate to prevent runaway agents.
spawn-batch.shauto-endorses all tasks in batch- Manual:
bash scripts/endorse-task.sh \x3Ctask-id> - 30-second cooldown between endorsement and spawn
3. Spawning
Each agent runs in:
- Isolated git worktree (
\x3Cproject>-worktrees/\x3Ctask-id>/) - tmux session (
claude-\x3Ctask-id>) - Non-interactive mode (
claude --print --permission-mode bypassPermissions) - Auto-retry with model fallback (opus → sonnet → haiku) on rate limits
4. Auto-Review
When an agent completes, notify-on-complete.sh:
- Detects completion (polls tmux every 60s)
- Sends notification
- Spawns a reviewer (sonnet) that checks the diff
- If issues found: fixes and commits (up to 3 rounds)
- Pushes final state
5. Integration
When all agents in a batch complete, integration-watcher.sh:
- Collects all branches
- Merges sequentially into main
- Uses opus to resolve any conflicts
- Runs integration review (opus, up to 3 rounds)
- Pushes to main (if auto-merge enabled)
Setup
- Copy this skill's
scripts/andconfig/to your workspace - Copy
config/swarm.conf.example→config/swarm.confand configure - Ensure installed:
bash 4+,tmux,git,gh,jq,claude(Claude Code CLI)
Notifications
Set SWARM_NOTIFY in swarm.conf:
webhook— POST toSWARM_WEBHOOK_URL(Slack/Discord/custom)telegram— Send viaSWARM_TELEGRAM_BOT_TOKEN+SWARM_TELEGRAM_CHAT_IDnone— Log only (default)
Hard Rules
- Always endorse before spawning — no exceptions
- Use spawn-batch.sh for 2+ tasks — starts integration watcher
- Never run bare
claude --printin background — use spawn-agent.sh - Let the watcher handle reviews — don't add review logic to prompts
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install claude-swarm - 安装完成后,直接呼叫该 Skill 的名称或使用
/claude-swarm触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Claude Swarm 是什么?
Claude-native multi-agent swarm orchestration for parallel coding. Use when spawning multiple Claude Code agents to work in parallel on a project with git wo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 106 次。
如何安装 Claude Swarm?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install claude-swarm」即可一键安装,无需额外配置。
Claude Swarm 是免费的吗?
是的,Claude Swarm 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Claude Swarm 支持哪些平台?
Claude Swarm 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Claude Swarm?
由 linkbag(@linkbag)开发并维护,当前版本 v1.0.0。