Agent swarm adapter — Claude Code leads, OpenCode executes. Save 70-80% tokens.
npx claudepluginhub apoapps/swarm-code-pluginHaiku-agent bridge — Claude Code spawns Haiku subagents that run OpenCode via CLI (opencode run). No tmux required. Workers stream colored logs to /tmp/swarm-code-logs/. Saves 70-80% tokens.
Agent swarm adapter for Claude Code + OpenCode. Claude Code leads the swarm — OpenCode workers execute the analytical grunt work. Save 70-80% Claude tokens without sacrificing quality.
NOT an official Anthropic or OpenCode product. Community plugin by Alejandro Apodaca Cordova. Not affiliated with Anthropic or OpenCode in any way.
swarm-code is an adapter that bridges Claude Code and OpenCode into a single agent swarm, with Claude Code as the permanent team lead.
WITHOUT swarm-code: WITH swarm-code:
User → Claude (does it all) User → Claude (directs)
↑ expensive ↓
OpenCode worker (executes)
↑ cheap / free
Claude (validates + delivers)
Anthropic's TOS blocks running Claude inside OpenCode. So this plugin does the reverse: OpenCode runs inside Claude Code, as a worker the team lead (Claude) can spawn, assign tasks to, and receive results from.
Claude Code (Sonnet/Opus) ← permanent team lead
│
├── opencode-worker (analytical tasks)
│ - code review
│ - implementation planning
│ - debugging analysis
│ - architecture questions
│
├── haiku-agent (file editing, cheap)
│
└── opencode-worker (parallel analysis)
Claude directs. OpenCode executes. Haiku edits. Each does what it's cheapest at.
| Role | Model | Cost | Does |
|---|---|---|---|
| Team lead | Claude Sonnet | $3/M | Directs, synthesizes, decides |
| Editor | Claude Haiku | $0.25/M | Reads files, edits code |
| Worker | OpenCode | ~$0 | Reviews, plans, analyzes |
~80% token savings on complex multi-step tasks.
| Command | What it does |
|---|---|
/swarm-code:init | Initialize the swarm — detect models, create oc-team pane, activate keyword watcher |
Claude delegates automatically once initialized — no other slash commands needed.
| Internal call | Claude uses when... |
|---|---|
execute "<task>" | Analysis or questions |
review | Code review of git changes |
plan "<task>" | Implementation planning |
orchestrate "<task>" | Complex multi-faceted tasks |
# https://opencode.ai/docs/install
claude plugin add /path/to/opencode-plugin-cc
# or install from marketplace
/swarm-code:init
Detects all available models on your system (50+), creates the oc-team split pane, activates the keyword watcher. That's it — Claude delegates automatically from here.
When you run /swarm-code:init inside a tmux session, swarm-code opens a horizontal split pane to the right of Claude Code:
┌─────────────────────┬──────────────────────────────┐
│ │ swarm-code · oc-team monitor │
│ Claude Code │ │
│ │ made by Alejandro Apodaca │
│ │ apoapps.com │
│ │ │
│ │ waiting for jobs... │
│ │ │
│ │ [job output streams here] │
└─────────────────────┴──────────────────────────────┘
_Gi=<id>;OK → keyword watcher detects it → OpenCode TUI opens in the paneThe plugin uses a keyword-based signal system so Claude can trigger the OpenCode TUI without executing shell commands:
Claude writes: _Gi=31337;OK
│ │ └── acknowledgement
│ └─────── session/job ID
└──────────── _G prefix (swarm-code signal namespace)
Watcher detects via tmux pipe-pane → respawns oc-team pane with opencode-splash.sh