OpenCode plugin for Claude Code
Tribute: This project is inspired by and pays homage to
codex-plugin-cc by OpenAI.
The plugin architecture, command structure, and design patterns are derived from
the original codex-plugin-cc project, adapted to work with
OpenCode instead of Codex.
Use OpenCode from inside Claude Code for code reviews or to delegate tasks.
This plugin is for Claude Code users who want an easy way to start using OpenCode from the workflow
they already have.
Quickstart
# 1. Install opencode (once)
npm i -g opencode-ai # or: brew install opencode
# 2. Install the plugin (see Install section below)
# 3. Run the self-test — fixes common footguns for you
node ~/.claude/plugins/cache/tasict-opencode-plugin-cc/opencode/1.1.0/scripts/opencode-companion.mjs doctor --fix
Then delegate a task from Claude Code:
/opencode:rescue grep for XXX in src/ and summarize
doctor --fix writes the correct ~/.config/opencode/opencode.json permissions so the
bash tool does not hang in headless mode (sst/opencode#14473). This is the single biggest
footgun for newcomers — ensureServer will also run this fix automatically on first use.
What You Get
/opencode:review for a normal read-only OpenCode review
/opencode:adversarial-review for a steerable challenge review
/opencode:rescue, /opencode:status, /opencode:result, and /opencode:cancel to delegate work and manage background jobs
Requirements
- Claude Code (CLI, desktop app, or IDE extension)
- OpenCode installed (
npm i -g opencode-ai or brew install opencode)
- A configured AI provider in OpenCode (Claude, OpenAI, Google, etc.)
- Node.js 18.18 or later
Install
Inside Claude Code, run:
! curl -fsSL https://raw.githubusercontent.com/tasict/opencode-plugin-cc/main/install.sh | bash
Then reload the plugin:
/reload-plugins
You should see:
Reloaded: 1 plugin · 7 skills · 6 agents · 3 hooks ...
Finally, verify your setup:
/opencode:setup
What the installer does: Clones the repo to ~/.claude/plugins/marketplaces/,
caches the plugin files, and registers it in Claude Code's plugin config.
It tries SSH first and falls back to HTTPS automatically.
Set up an AI Provider
If OpenCode is installed but no AI provider is configured, set one up:
! opencode providers login
To check your configured providers:
! opencode providers list
Uninstall
/plugin uninstall opencode@tasict-opencode-plugin-cc
/reload-plugins
Command Mapping (codex-plugin-cc -> opencode-plugin-cc)
| codex-plugin-cc | opencode-plugin-cc | Description |
|---|
/codex:review | /opencode:review | Read-only code review |
/codex:adversarial-review | /opencode:adversarial-review | Adversarial challenge review |
/codex:rescue | /opencode:rescue | Delegate tasks to external agent |
/codex:status | /opencode:status | Show running/recent jobs |
/codex:result | /opencode:result | Show finished job output |
/codex:cancel | /opencode:cancel | Cancel active background job |
/codex:setup | /opencode:setup | Check install/auth, toggle review gate |
Slash Commands
/opencode:review -- Normal OpenCode code review (read-only). Supports --base <ref>, --wait, --background.
/opencode:adversarial-review -- Steerable review that challenges implementation and design decisions. Accepts custom focus text.
/opencode:rescue -- Delegates a task to OpenCode via the opencode:opencode-rescue subagent. Supports --model, --agent, --resume, --fresh, --background.
/opencode:status -- Shows running/recent OpenCode jobs for the current repo.
/opencode:result -- Shows final output for a finished job, including OpenCode session ID for resuming.
/opencode:cancel -- Cancels an active background OpenCode job.
/opencode:setup -- Checks OpenCode install/auth, can enable/disable the review gate hook.
Review Gate
When enabled via /opencode:setup --enable-review-gate, a Stop hook runs a targeted OpenCode review on Claude's response. If issues are found, the stop is blocked so Claude can address them first. Warning: can create long-running loops and drain usage limits.
Job Auto-Heal
Long-running tasks spawned via /opencode:task --background occasionally get
stuck in investigating status even after the OpenCode session has finished
server-side — typically because POST /session/:id/message fails to close its
HTTP body, the task-worker is killed, or the companion's watcher misses the
terminal signal.
The companion now reconciles this automatically: