Let Claude Code or Codex hand the grunt work to a cheaper model via OpenCode.
The problem: frontier models (Claude, GPT-class) are your best tool for architecture, hard bugs, and judgment calls — and expensive overkill for the mechanical majority of real coding work: boilerplate, tests, lint/type fixes, repetitive multi-file edits. Doing all of it with your primary agent burns premium tokens and fills its context with busywork instead of the decisions that actually need it.
What this tool does: it gives your primary agent a tool to hand that busywork to a cheaper model — or a free one — running through OpenCode, without leaving your workflow. The primary agent stays focused on what matters; the cheap model grinds through the repetitive stuff and reports back. Which model does the work is a config change, not a redeploy — switch it any time.
Run the script once to install & register the server.
Choose a preset to auto-fill the model, or pick Custom to type your own — a local Ollama/LM Studio model works too.
The cheap model that does the busywork. Run opencode models for the full list.
Which agents should get the delegate_* tools.
Teaches the agent when to auto-delegate. When does it delegate? →
Leave blank to use the calling agent's current directory.
Leave blank to auto-detect with command -v opencode.
Where the server was installed (default shown). Used to locate it when reconfiguring.
One command, one paste. Copy it and run it in your terminal — it downloads and installs in a single step, no follow-up needed.
📄 Prefer to inspect the script first? Read install.sh →
opencode auth login).
Installing the tools doesn't force your agent to use them — it decides, guided by its instruction file (CLAUDE.md for Claude Code, AGENTS.md for Codex). Tick "Delegation policy" above to install this exact table into that file — and edit it any time to change the conditions.
✅ Delegate — high volume, low risk
delegate_tests)⛔ Keep on the primary agent
Rule of thumb: high volume + low risk → delegate. Low volume + high risk → keep it. Unsure → keep it.
opencode auth login.opencode-delegate.