Skip to content

lxb12123/opencode-plugin-cc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode plugin for Claude Code

Use OpenCode from inside Claude Code for code reviews or to delegate tasks to OpenCode.

This plugin is for Claude Code users who want an easy way to start using OpenCode from the workflow they already have.

What You Get

  • /opencode:review for a standard code 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

  • OpenCode CLI — Install from opencode.ai
  • Node.js 18.18 or later
  • A configured AI provider — Set up via opencode /connect or environment variables (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.)

Install

Add the marketplace in Claude Code:

/plugin marketplace add <your-github-username>/opencode-plugin-cc

Install the plugin:

/plugin install opencode@<your-marketplace>

Reload plugins:

/reload-plugins

Then run:

/opencode:setup

/opencode:setup will tell you whether OpenCode is ready. If OpenCode is missing, it can offer to install it for you.

If you prefer to install OpenCode yourself, use:

curl -fsSL https://opencode.ai/install | bash

Usage

/opencode:review

Runs an OpenCode review on your current work.

Use it when you want:

  • a review of your current uncommitted changes
  • a review of your branch compared to a base branch like main

Use --base <ref> for branch review. It also supports --wait and --background.

Examples:

/opencode:review
/opencode:review --base main
/opencode:review --background

/opencode:adversarial-review

Runs a steerable review that questions the chosen implementation and design.

Use it to pressure-test assumptions, tradeoffs, failure modes, and whether a different approach would have been safer or simpler.

Examples:

/opencode:adversarial-review
/opencode:adversarial-review --base main challenge whether this caching design is correct
/opencode:adversarial-review --background look for race conditions

/opencode:rescue

Hands a task to OpenCode through the opencode:opencode-rescue subagent.

Use it when you want OpenCode to:

  • investigate a bug
  • try a fix
  • continue a previous OpenCode session
  • take a pass with a different model

Supports --background, --wait, --resume, --fresh, --model, --variant, and --agent.

Examples:

/opencode:rescue investigate why the tests started failing
/opencode:rescue fix the failing test with the smallest safe patch
/opencode:rescue --resume continue the previous investigation
/opencode:rescue --model openai/gpt-4.1 --variant high investigate the flaky test
/opencode:rescue --background investigate the regression

You can also just ask for a task to be delegated to OpenCode:

Ask OpenCode to redesign the database connection to be more resilient.

/opencode:status

Shows running and recent OpenCode jobs for the current repository.

/opencode:status
/opencode:status task-abc123

/opencode:result

Shows the final stored OpenCode output for a finished job.

/opencode:result
/opencode:result task-abc123

/opencode:cancel

Cancels an active background OpenCode job.

/opencode:cancel
/opencode:cancel task-abc123

/opencode:setup

Checks whether OpenCode is installed and ready. If OpenCode is missing, it can offer to install it.

/opencode:setup

Typical Flows

Review Before Shipping

/opencode:review

Hand A Problem To OpenCode

/opencode:rescue investigate why the build is failing in CI

Start Something Long-Running

/opencode:adversarial-review --background
/opencode:rescue --background investigate the flaky test

Then check in with:

/opencode:status
/opencode:result

OpenCode Integration

This plugin wraps the OpenCode CLI run command for non-interactive execution. It uses the global opencode binary installed on your machine.

Model Configuration

You can specify models using the --model flag in provider/model format:

/opencode:rescue --model openai/gpt-4.1 fix the bug
/opencode:rescue --model anthropic/claude-sonnet-4-20250514 investigate the issue

You can also set a default model by configuring OpenCode directly.

Provider Setup

OpenCode supports multiple AI providers. Configure them by:

  1. Running opencode and using /connect
  2. Setting environment variables like OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, etc.

See the OpenCode docs for full configuration options.

About

Use OpenCode from Claude Code to review code or delegate tasks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors