Multi-CLI agent orchestration. One command, multiple AI models, coordinated work.
Claude Swarm orchestrates Claude Code, Codex CLI, and Gemini CLI from a single terminal. Spawn a swarm of agents with different roles and models, monitor them in real-time, and collect results β all locally.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π CLAUDE SWARM β "Build a REST API" β
β Mode: pipeline | Agents: 1/3 done | Elapsed: 45s β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββ DONE planner (claude/sonnet-4-6) β
β Completed in 32s | 2.1KB output β
β β
β ββββββββββββββ RUN implementer (codex/o4-mini) β
β 18s elapsed | 1.4KB output | 23 lines β
β > Writing Express routes for /todos endpoints... β
β β
β ββββββββββββββ WAIT reviewer (gemini/pro) β
β Waiting... β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Latest output (implementer): β
β > Created src/routes/todos.ts with CRUD endpoints β
β > Added input validation with zod schemas β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Every AI coding tool runs in its own silo. Claude Code doesn't talk to Codex. Codex doesn't talk to Gemini. You copy-paste between terminals.
Claude Swarm is the layer above the agents. It coordinates them:
- Claude plans the architecture (best at reasoning)
- Codex writes the code (best at implementation)
- Gemini reviews the result (independent perspective)
One command. Multiple models. Coordinated output.
git clone https://github.com/nghiack7/claude-swarm.git
cd claude-swarm
npm installnpx tsx src/cli.ts run "Build a todo REST API with Express and TypeScript"npx tsx src/cli.ts run "Fix the auth bug in src/auth.ts" \
--agent "analyst:claude:claude-sonnet-4-6" \
--agent "fixer:codex:o4-mini" \
--agent "reviewer:claude:claude-haiku-4-5-20251001"npx tsx src/cli.ts run "Review this codebase for security issues" \
--agent "security:claude" \
--agent "deps:codex" \
--agent "secrets:gemini" \
--mode parallelnpx tsx src/cli.ts adaptersCLI Adapters
claude β available (default model: claude-sonnet-4-6)
codex β available (default model: o4-mini)
gemini β not found (default model: gemini-2.5-pro)
role:cli:model Full spec e.g. planner:claude:claude-sonnet-4-6
role:cli Default model e.g. coder:codex
role Default CLI e.g. reviewer (uses claude)
Agents run sequentially. Each agent receives the output of all previous agents as context.
planner βββ implementer βββ reviewer
output ββββββ output ββββββββ output
Best for: feature building, bug fixing, any task where later steps depend on earlier ones.
All agents run simultaneously with the same task description. No shared context between agents.
ββ security-reviewer
ββ performance-auditor (all run at once)
ββ code-quality-checker
Best for: independent reviews, multi-perspective analysis, parallelizable work.
User
β
βΌ
CLI (claude-swarm run)
β
ββββ Orchestrator
β βββ Adapter: Claude Code (claude -p "...")
β βββ Adapter: Codex CLI (codex exec "...")
β βββ Adapter: Gemini CLI (gemini -p "...")
β
ββββ TUI Dashboard (live terminal monitoring)
β
ββββ Broker (localhost:7899 + SQLite)
βββ peers (discovery + status)
βββ rooms (collaboration groups)
βββ messages (queue + history)
βββ tasks (delegation + tracking)
βββ scratchpad (shared memory)
Two layers:
- Orchestrator β spawns CLI processes, constructs role-specific prompts, manages lifecycle, collects output. This is the new part.
- Broker β the existing peer coordination system. MCP-connected Claude Code sessions can still discover each other, form rooms, and collaborate in real-time.
The orchestrator is one way to use Claude Swarm. You can also use it as an MCP server for real-time peer coordination between manually-opened sessions.
claude mcp add --scope user --transport stdio claude-swarm -- npx tsx $(pwd)/src/server.ts| Category | Tools |
|---|---|
| Core | list_peers, send_message, broadcast, check_messages, message_history, set_summary, set_name, set_status |
| Rooms | create_room, join_room, leave_room, list_rooms |
| Tasks | create_task, update_task, list_tasks |
| Scratchpad | scratchpad_get, scratchpad_set, scratchpad_list |
# Orchestration
claude-swarm run <task> # Run a multi-agent swarm
claude-swarm adapters # List available CLI adapters
# Coordination
claude-swarm status # Dashboard overview
claude-swarm peers # List peers
claude-swarm rooms # List rooms
claude-swarm send <id> <msg> # Send direct message
claude-swarm broadcast <room> <msg> # Broadcast to room
claude-swarm history [--room <id>] [--search <term>]
claude-swarm tasks <room_id> # List tasks
claude-swarm scratchpad <room_id> # Shared memory
claude-swarm kill # Kill broker
claude-swarm help # Help- You run
claude-swarm run "your task"with agent specs - The orchestrator constructs a role-specific prompt for each agent
- In pipeline mode, each agent's output becomes context for the next
- In parallel mode, all agents run simultaneously
- The TUI shows live progress: status, output size, latest lines
- When complete, a summary shows each agent's output and timing
Each agent runs as a real CLI subprocess (claude -p, codex exec, gemini -p) with full tool access. They can edit files, run tests, and interact with your codebase.
When no --agent flags are specified, Claude Swarm uses a 3-agent pipeline:
| Step | Role | CLI | Purpose |
|---|---|---|---|
| 1 | Planner | Claude | Architecture and implementation plan |
| 2 | Implementer | Claude | Write the code following the plan |
| 3 | Reviewer | Claude | Review for bugs, edge cases, improvements |
Customize by passing --agent flags. Mix and match CLIs freely.
- Multi-CLI: Not locked to one AI provider. Claude, Codex, Gemini, and any future CLI that accepts a prompt and returns output.
- Local-only: All traffic on 127.0.0.1. No cloud coordination, no API keys for swarm features.
- Protocol-agnostic: The broker speaks HTTP + SQLite. Any process can participate.
- Zero config: No YAML files needed. Agent specs are CLI flags. Defaults work out of the box.
- Adapter pattern: Adding a new CLI is ~20 lines. Implement
available()andspawn().
Edit src/adapters.ts:
const myAdapter: CLIAdapter = {
name: "mycli",
defaultModel: "my-model",
available: () => commandExists("mycli"),
spawn: ({ prompt, model, cwd }) => {
return spawn("mycli", ["run", prompt, "--model", model], {
cwd, stdio: ["ignore", "pipe", "pipe"],
});
},
};Then add it to the adapters registry. That's it.
| Variable | Default | Description |
|---|---|---|
CLAUDE_SWARM_PORT |
7899 |
Broker port |
CLAUDE_SWARM_DB |
~/.claude-swarm.db |
SQLite path |
| Feature | Claude Swarm | Agent Teams | AMUX | Conductor |
|---|---|---|---|---|
| Multi-CLI (Claude+Codex+Gemini) | β | β (Claude only) | β | β |
| One-command orchestration | β | β | β | β |
| Live TUI dashboard | β | β | Web UI | β |
| Per-role model selection | β | β | β | β |
| Pipeline + parallel modes | β | Parallel only | Parallel only | Parallel only |
| MCP peer coordination | β | β | β | β |
| Shared scratchpad memory | β | Shared tasks | β | β |
| Zero cloud dependency | β | β | β | β |
| Adapter pattern (extensible) | β | β | β | β |
MIT
