Skip to content

xunhe730/cc-opencode

Repository files navigation

cc-opencode

CI License: MIT Node 20+

Claude as Brain, opencode as Hands.

A Claude Code plugin that decomposes coding tasks with Claude (the thinker), then fans them out as parallel workers via the opencode CLI configured with cost-effective providers (DeepSeek, Qwen, Gemini Flash, GLM, Kimi).

Prerequisites: Claude Code and opencode must already be installed and configured.

Installation

git clone https://github.com/xunhe730/cc-opencode.git
bash cc-opencode/install.sh

Then restart Claude Code and run /opencode:setup to verify.

Commands

Command Description
/opencode:swarm "<brief>" Decompose + fan out workers in parallel
/opencode:plan "<brief>" Dry run — planner only, prints JSON plan
/opencode:setup Preflight check (opencode version + live probe)
/opencode:providers Print provider matrix + recommended two-tier preset
/opencode:status Show last planner/worker sessions for this cwd
/opencode:resume Resume last planner or worker session
/opencode:cancel Cancel active workers (SIGTERM → grace → SIGKILL)

Brain / Hands Architecture

/opencode:swarm "<brief>"
        │
        ├─ Claude (Brain): decompose → plan → risk gate → synthesize
        │
        ├─ Task(opencode-planner)
        │     └─ node companion.mjs plan "<brief>"
        │            └─ opencode run --format json ...
        │     ← JSON plan: [{id, title, files[], risk_level, depends_on[]}]
        │
        ├─ orchestrator: print table, safety uplift, risk gate (AskUserQuestion)
        │
        └─ Task(opencode-worker, subtask) × N  [parallel, dependency-ordered]
              └─ node companion.mjs work '{...}'
                     └─ opencode run --dangerously-skip-permissions ...
              ← {status, files_touched, summary, evidence}

Claude never writes code directly. opencode workers do the actual edits. Claude owns decomposition, risk gating, overlap detection, and synthesis.

Provider Configuration

Run /opencode:providers to see the full provider matrix with pricing and JSON-mode fidelity. Recommended two-tier preset:

planner: deepseek-chat   (DeepSeek-V3, $0.27/1M in)
worker:  qwen3-coder     (Qwen3-Coder,  $0.20/1M in)

See docs/providers.md for the complete table and opencode config blocks.

Safety

  • Workers run with --dangerously-skip-permissionsalways run on a feature branch.
  • Tasks touching .env*, *credentials*, *.key, *secret*, id_rsa*, *.pem are auto-uplifted to risk_level: high and require explicit approval before execution.
  • /opencode:cancel terminates all active workers with zero orphan guarantee.

Installation Options

bash install.sh                   # default (refuses if already installed)
bash install.sh --force           # overwrite existing install
bash install.sh --name-suffix cc  # install alongside as /cc-opencode:*

See MIGRATION.md if you have the local opencode plugin already installed.

Defaults

Knob Default
Model / provider Inherited from opencode config
--max-parallel 5
Planner timeout 120 s
Worker timeout Per providers/capabilities.json, fallback 600 s
Cancel grace period OPENCODE_CANCEL_GRACE_MS (default 5000 ms)
Transient retry 3 attempts, 1/4/16 s backoff

License

MIT — see LICENSE.

About

Claude as Brain, opencode as Hands — a Claude Code plugin for AI-orchestrated parallel code edits via cost-effective providers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors