OpenCode Claude Auth Plugin
raw JSON → 1.3.9 verified Sat Apr 25 auth: no javascript
OpenCode Claude Auth (v1.3.9) is an Anthropic auth plugin for OpenCode that translates Anthropic /v1/messages requests into local Claude CLI executions instead of using OAuth or API keys. Backed by Claude Code CLI, it streams tool lifecycles, handles tool budget, and remaps OpenCode tool aliases. Rapid bug-fix cycle (multiple releases per week). Test the local CLI before debugging the plugin. Not for third-party consumption.
Common errors
error claude: command not found ↓
cause Claude Code CLI not installed or not in PATH.
fix
Install Claude Code CLI or use full path in configuration.
error claude auth status returns loggedIn: false ↓
cause User not authenticated with Claude.
fix
Run
claude auth login or similar to authenticate. error Error: Cannot find module 'opencode-cluade-auth' ↓
cause Plugin not installed or not referenced correctly in config.
fix
Ensure 'opencode-cluade-auth@version' is in plugin array or path is correct.
Warnings
gotcha Plugin requires locally working Claude Code CLI. Test with `claude auth status` and `claude -p "OK" ...` before debugging. ↓
fix Ensure Claude CLI is installed and logged in.
gotcha Not a general-purpose Anthropic adapter; unsupported for third-party consumption. Restricted internal production scope. ↓
fix Do not use outside of OpenCode internal flow.
breaking Config file and plugin installation directory may differ. OpenCode may resolve plugin from separate cache. ↓
fix Inspect actual installed artifact, not just config file.
gotcha Manual npm install is optional and usually not needed for normal OpenCode usage. ↓
fix Add plugin reference in OpenCode config instead of npm install.
deprecated Pinning to 'latest' may cause unexpected changes. Use specific version for deterministic installs. ↓
fix Use 'opencode-cluade-auth@<version>' in plugin config.
Install
npm install opencode-cluade-auth yarn add opencode-cluade-auth pnpm add opencode-cluade-auth Imports
- default (plugin entry) wrong
const plugin = require('opencode-cluade-auth')correctimport plugin from 'opencode-cluade-auth'
Quickstart
// Add to OpenCode config (config.json):
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-cluade-auth@latest"],
"provider": {
"anthropic": {
"name": "Anthropic",
"npm": "@ai-sdk/anthropic"
}
}
}
// Then restart OpenCode and send a request via Anthropic provider.