unixfox/opencode-claude-code-plugin
64 stars · Last commit 2026-04-06
Use Claude Code in OpenCode - created from idea https://github.com/anomalyco/opencode/issues/9677
README preview
# opencode-claude-code A standalone [opencode](https://github.com/opencodeco/opencode) provider plugin that uses [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) as a backend. It spawns `claude` as a subprocess with `--output-format stream-json --input-format stream-json`, implements the AI SDK `LanguageModelV2` interface, and streams responses back to opencode. This is a **standalone npm package** that opencode loads dynamically via its external provider system -- no modifications to opencode's source code required. ## Prerequisites - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated (`claude` available in your PATH) - [opencode](https://github.com/opencodeco/opencode) installed ## Installation ### Local development ```bash git clone <this-repo> cd opencode-claude-code bun install bun run build