Opencode Claude Bridge banner
dotCipher dotCipher

Opencode Claude Bridge

Development community

Description

OpenCode plugin for Claude Pro/Max OAuth — auto-syncs from Claude CLI

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

opencode-claude-bridge

Use your Claude Pro/Max subscription in [OpenCode](https://opencode.ai). If you're logged into the Claude CLI, it just works — no extra setup.

Install

Add to `~/.config/opencode/opencode.json`:

{
  "plugin": ["opencode-claude-bridge"]
}

OpenCode auto-installs the plugin from npm on next launch.

If you're logged into the Claude CLI (`claude login`), the plugin auto-syncs your credentials — just select an Anthropic model and start chatting. If not, you'll be prompted to authenticate via browser OAuth or enter an API key.

**Upgrade:**

OpenCode pins the installed version. To upgrade to the latest:

cd ~/.cache/opencode && npm install opencode-claude-bridge@latest

Then restart OpenCode.

Install from source
git clone https://github.com/dotCipher/opencode-claude-bridge.git ~/opencode-claude-bridge
cd ~/opencode-claude-bridge && npm install && npm run build

Then reference the full path in your config:

{
  "plugin": ["/Users/YOU/opencode-claude-bridge/dist/index.js"]
}

How the bridge works

The plugin sits between OpenCode and the Anthropic API:

**OpenCode** -> **opencode-claude-bridge** -> **Anthropic API**

Authentication

Supports both OAuth and API key auth:

  • OAuth (Pro/Max) — Auto-reads your Claude CLI's OAuth tokens from macOS Keychain (or ~/.claude/.credentials.json on Linux). No browser flow needed. If Claude CLI isn't available, falls back to browser-based OAuth PKCE.
  • API key — Works alongside a standard provider entry in your OpenCode config with an apiKey. The plugin only activates its OAuth handling for the built-in anthropic provider; custom API key providers pass through unchanged.
  • Token refresh — When tokens expire, three layers are tried: re-read from Keychain, refresh via stored token, refresh via CLI's token.

Wire-level request matching

Every outbound OAuth request is rewritten to match w