cc-oc
Controlled launcher for opencode, invoked from inside Claude Code. Per-spawn MCP control, session ledger, foreground or detached.
Each /oc:spawn is one ephemeral opencode run --format json invocation against your own opencode config (~/.config/opencode/opencode.json + workspace .opencode/). The plugin only writes a tiny per-spawn override file when you ask it to disable specific MCP servers — otherwise opencode runs entirely against your existing setup, untouched.
A thin local ledger tracks the sessions spawned by /oc:spawn so /oc:tail, /oc:sessions, and /oc:cancel can filter to your bridge sessions rather than every opencode session on the machine.
No broker, no daemon, no extra processes. Zero npm dependencies. Native Node ESM.
Install
cc-oc is published as a standalone Claude Code marketplace — you add the repo as a marketplace, then install the oc plugin from it.
/plugin marketplace add anfreire/cc-oc
/plugin install oc@cc-oc
/reload-plugins
After /reload-plugins (or on the next Claude Code session), /oc:spawn, /oc:tail, /oc:sessions, and /oc:cancel become available.
Uninstall:
/plugin uninstall oc@cc-oc
/plugin marketplace remove cc-oc
Prerequisites:
"Zero config" means zero cc-oc config — the plugin works out of the box with no ~/.claude/oc.json. It does not configure opencode for you; whatever you'd see typing opencode run "…" directly is what cc-oc launches. If opencode itself is unauthenticated, has no model selected, or otherwise can't run, the first /oc:spawn will surface opencode's own error verbatim.
Quick start
/oc:spawn --read-only -- "summarize the architecture of this repo"
/oc:spawn --bg -- "find every place that calls foo() and report"
/oc:spawn --exclude-mcp playwright -- "quick scan, no browser needed"
/oc:tail # peek at the latest job
/oc:tail --follow # block until done
/oc:sessions # list your spawned jobs
/oc:cancel <id> # abort one
/oc:cancel --all # abort all running in this CC session
Append --help to any command for the full flag list inline.
Commands
| Command | Purpose |
|---|
/oc:spawn | Spawn an opencode task. Foreground by default; opencode's own permission gating applies (override with --write). Flags: --bg, --write, --model, --variant, --agent, --cwd, --continue <sid>, --fresh, --exclude-mcp <names>, --include-mcp <names>, --pure / --no-pure, --project / --no-project, --reasoning, --json. Prompt after --. |
/oc:tail | Stream/peek a session's events. Flags: --follow, --lines N, --since ms, --reasoning, --raw, --json. No arg → latest active job. |
/oc:sessions | List + inspect. Flags: --all, --json. Pass a session id (or unique prefix) for full details. |
/oc:cancel | Cancel one or all. --all scopes to this CC session; add --workspace to widen. --json for machine-readable. |
oc-delegate subagent
The plugin also ships an optional oc-delegate subagent. Claude may invoke it on its own when an autonomous plan reaches a step that would bloat the parent context (large explorations, second-opinion reviews, sandboxed writes). The subagent makes one delegated /oc:spawn call and returns only a short summary — the verbatim opencode transcript stays in the subagent's own context.
Configuration
Optional file at ~/.claude/oc.json. Defaults are sensible — if you skip it entirely, the plugin works.
{
"$schema": "https://github.com/anfreire/cc-oc/raw/main/plugins/oc/schemas/oc.config.schema.json",
"opencode": {
"model": null, // null = inherit opencode default
"variant": null,
"agent": null,
"sandbox": "read-only", // "read-only" | "workspace-write"
"excludeMcps": [], // MCP server names from your opencode config to disable on every spawn
"disableProjectConfig": false, // skip <cwd>/.opencode/
"pure": false // pass --pure to opencode (skip its external plugins)
},
"retention": { "logsDays": 14, "maxLogsMb": 500 }
}
The $schema URL gives you tooltips and validation in editors that understand JSON Schema (VS Code, Cursor, IntelliJ, …).
Per-spawn overrides
Any /oc:spawn flag overrides the user config for that single call: