By apoapps
Delegate code tasks like review, planning, and analysis to token-efficient Haiku subagents that run OpenCode headlessly, with prompt templates and result validation, saving 70-80% tokens.
Delegate one or more tasks to OpenCode workers (Haiku subagents). Single worker for focused tasks, multiple workers in parallel for complex ones. No tmux required.
How to compose effective prompts for OpenCode workers. Include context inline, be specific, set output format.
How Claude should process and present OpenCode worker results — validate, synthesize, present. Token-efficient.
Spawn a Haiku worker to run a task via OpenCode. The worker calls oc-run.sh which executes opencode run headlessly. No tmux, no server, no custom UI.
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
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
npx claudepluginhub apoapps/swarm-code-plugin --plugin swarm-codeMulti-agent orchestration framework for Claude Code. Routes tasks to specialized Haiku/Sonnet subagents while Opus orchestrates — inspired by speculative decoding. Includes 10 specialized heads, environment preflight checks, and ~50% API cost reduction.
Multi-agent orchestration for Claude Code. 12 specialized agents working in parallel — planning, building, reviewing, debugging. Plus a Hub for always-alive multi-project sessions controllable from Telegram or Slack.
Launch agent teams for any kind of work — coding, writing, diagnosis, and more
Orchestrate multi-agent teams for parallel code review, hypothesis-driven debugging, and coordinated feature development using Claude Code's Agent Teams
Claude Code workflow patterns: prompting, CLAUDE.md maintenance, multi-agent orchestration
Orchestrate OpenAI Codex agents from Claude Code via tmux sessions