Codebuff-style multi-agent swarms for OpenCode:
- one swarm = multiple OpenCode sessions (planner/researcher/coder/reviewer)
- agent-to-agent messaging (
swarm.send) - parallel fan-out with basic model-collision gating (
swarm.parallel) - auto-discovery from session titles (
swarm.discover)
Copy (or symlink) the plugin into your repo so plain opencode auto-loads it:
mkdir -p .opencode/plugins
cp /path/to/opencode-omoc-swarm/plugins/omoc-swarm.ts .opencode/plugins/omoc-swarm.tsThen run OpenCode as usual:
opencodeswarm.create— create a swarm (child sessions)swarm.discover— discover/register a swarm from existing session titlesswarm.status— show members + session IDsswarm.parallel— run a prompt across members (parallel where possible)swarm.send— message another member (routes as a prompt)swarm.forget— forget local swarm mapping (sessions remain)swarm.max— MAX mode: parallel editor tries in isolated git worktrees + selector picks winner (optional apply)swarm.jam— collaborative run in the same worktree (no isolation)swarm.loop— queue runner: read.omoc-queue.jsonand execute tasks viaswarm.jam/swarm.max
This repo ships a launcher:
./bin/oc-swarm --dir /path/to/your/projectRequirements: tmux, curl, jq, lsof, and opencode on PATH.
If you want opencode to always start in the side-by-side tmux UI inside a project, use direnv to prepend that
project's bin/ to PATH, and ship a tiny bin/opencode wrapper that launches bin/oc-swarm.
- Install
direnv:
brew install direnv- Enable the
direnvhook once for your shell (example: zsh):
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc
exec zshIn your target project repo:
mkdir -p bin
cp /path/to/opencode-omoc-swarm/bin/oc-swarm bin/oc-swarm
cp /path/to/opencode-omoc-swarm/templates/bin/opencode bin/opencode
cp /path/to/opencode-omoc-swarm/templates/.envrc .envrc
chmod +x bin/oc-swarm bin/opencode
direnv allowNow opencode (without subcommands) will always open the side-by-side tmux UI.
OMOC_NO_TMUX=1 opencode
# or
opencode --no-tmux