OpenCode 2 plugin that uses your existing Claude Code credentials — no separate login needed.
# Add to your Claude Code skills
git clone https://github.com/griffinmartin/opencode-claude-authGuides for using ide extensions skills like opencode-claude-auth.
Last scanned: 11/29/2026
{
"issues": [
{
"type": "npm-audit",
"message": "@npmcli/arborist: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@npmcli/config: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@npmcli/map-workspaces: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@npmcli/metavuln-calculator: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@npmcli/package-json: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@npmcli/run-script: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@opencode/plugin: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@opencode/util: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@sigstore/sign: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@sigstore/tuf: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@tufjs/models: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "cacache: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "gaxios: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "gcp-metadata: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "glob: Glob: AbortSignal cancellation bypass allows post-timeout filesystem traversal",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "ignore-walk: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "make-fetch-happen: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "minimatch: minimatch has potential denial of service via globparts amplification",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "npm-packlist: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "npm-registry-fetch: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "oxfmt: Vulnerability found",
"severity": "critical"
},
{
"type": "npm-audit",
"message": "pacote: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "rimraf: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "sigstore: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "tinypool: Tinypool: Prototype Pollution gadget in worker options leads to Remote Code Execution",
"severity": "critical"
},
{
"type": "npm-audit",
"message": "tuf-js: Vulnerability found",
"severity": "medium"
}
],
"status": "FAILED",
"scannedAt": "2026-11-29T13:00:29.009Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}opencode-claude-auth is an open-source ide extensions skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by griffinmartin. OpenCode 2 plugin that uses your existing Claude Code credentials — no separate login needed. It has 1,329 GitHub stars.
opencode-claude-auth failed AgentsLLM's automated security scan, which flagged one or more high-severity issues. Review the Security Report section carefully before using it.
Clone the repository with "git clone https://github.com/griffinmartin/opencode-claude-auth" and add it to your Claude Code skills directory (see the Installation section above).
opencode-claude-auth is primarily written in TypeScript. It is open-source under griffinmartin on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other IDE Extensions skills you can browse and compare side by side. Open the IDE Extensions category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh opencode-claude-auth against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Requires a passing catalog security scan. Resolve the flagged issues and resubmit to enable featuring.
Self-contained Anthropic auth provider for OpenCode 2 using your Claude Code subscription credentials — no separate login or API key needed.
3.0.0 and later require OpenCode 2.0+ and will not load on OpenCode 1.x. The last version that supports OpenCode 1.x is 2.2.1 — see Migrating from OpenCode 1.
| opencode-claude-auth | OpenCode | Config key | Install |
|---|---|---|---|
| 3.0.0+ | 2.0+ only | plugins |
opencode-claude-auth@latest |
| 2.2.1 and earlier | 1.x | plugin |
[email protected] |
The plugin registers a Claude Code subscription auth method on OpenCode's built-in Anthropic provider. Run /connect, choose Anthropic, then Import Claude Code subscription — it reads OAuth tokens directly from the macOS Keychain (or ~/.claude/.credentials.json — or $CLAUDE_CONFIG_DIR/.credentials.json if that env var is set — on other platforms) and hands them to OpenCode.
OpenCode's native Anthropic provider handles prompt conversion and streaming. Session hooks add the Claude Code identity and adjust subscription requests to set Authorization: Bearer with the current access token (and strip x-api-key), translate tool names, and process responses. OpenCode owns the credential's lifecycle from there and calls back into the plugin to refresh it as needed. Refreshes go directly to Anthropic's OAuth endpoint (zero LLM tokens consumed); the plugin always checks the keychain first and adopts whatever is there if it differs from what OpenCode handed back, so an independent claude re-login or refresh doesn't leave OpenCode stuck retrying a dead token. It falls back to the claude CLI only in the narrow window where Claude Code will actually rotate the token.
If you run CLIProxyAPI, you don't need this plugin. CLIProxyAPI logs in to your Claude Code account with OAuth, handles token refresh, and exposes a Claude-compatible API on http://localhost:8317 by default. Point OpenCode's built-in Anthropic provider at it:
Log in with your Claude Code account (via the proxy's -claude-login flag) and set an api-keys entry in its config.yaml.
Configure the Anthropic provider in ~/.config/opencode/opencode.json:
{
"provider": {
"anthropic": {
"options": {
"baseURL": "http://localhost:8317",
"apiKey": "your-api-key-1"
}
}
}
}
Remove opencode-claude-auth from your plugins list when using this setup — the two approaches shouldn't be combined. CLIProxyAPI also supports multi-account load balancing and other providers (Codex, Gemini, Grok). This plugin remains the lighter option if you only need Claude Code credentials in OpenCode with no extra service running.
claude at least once)macOS is preferred (uses Keychain). Linux and Windows work via the credentials file fallback.
For Humans
Option A: Let an LLM do it
Paste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):
Install the opencode-claude-auth plugin and configure it by following: https://raw.githubusercontent.com/griffinmartin/opencode-claude-auth/main/installation.md
Option B: Manual setup
Add the plugin to ~/.config/opencode/opencode.json:
{
"plugins": ["opencode-claude-auth@latest"]
}
OpenCode 2 uses the
pluginskey (plural) — OpenCode 1 usedplugin(singular). The@latesttag ensures OpenCode always pulls the newest version on startup. No manualnpm installis needed — OpenCode automatically installs npm plugins using Bun at startup.
Connect it — restart OpenCode, run /connect, choose Anthropic, then Import Claude Code subscription. Use /models and pick a model under Anthropic.
For LLM Agents
See installation.md for step-by-step agent instructions.
Run /connect once to import your Claude Code subscription, then use OpenCode normally — the plugin refreshes credentials automatically and provides them to the Anthropic API. If your credentials aren't OAuth-based, the connection falls through to standard API key auth.
OpenCode 2 replaced the plugin and auth APIs this plugin used under OpenCode 1, so 3.0.0 and later only load on OpenCode 2.
Upgrade OpenCode — see the OpenCode 2 migration guide.
In ~/.config/opencode/opencode.json, move the plugin from the plugin key (OpenCode 1) to plugins (OpenCode 2):
{
"plugins": ["opencode-claude-auth@latest"]
}
Restart OpenCode, run /connect, choose Anthropic, then Import Claude Code subscription. The OpenCode 1 connection isn't carried over.
2.2.1 is the last release that supports OpenCode 1. Pin it instead of tracking @latest:
{
"plugin": ["[email protected]"]
}
14 supported models. Run pnpm run test:models to verify against your account.
| Model |
|---|
| claude-fable-5 |
| claude-fable-5-1 |
| claude-haiku-4-5 |
| claude-haiku-4-5-20251001 |
| claude-opus-4-5 |
| claude-opus-4-5-20251101 |
| claude-opus-4-6 |
| claude-opus-4-7 |
| claude-opus-4-8 |
| claude-opus-5 |
| claude-sonnet-4-5 |
| claude-sonnet-4-5-20250929 |
| claude-sonnet-4-6 |
| claude-sonnet-5 |
The plugin checks these in order:
Claude Code-credentials* entries — multiple accounts are detected automatically)~/.claude/.credentials.json (fallback, works on all platforms; if CLAUDE_CONFIG_DIR is set, reads $CLAUDE_CONFIG_DIR/.credentials.json instead)If you have multiple Claude Code accounts authenticated on macOS, they're all detected from the Keychain automatically and offered as a selection prompt when you run /connect. Each account is labeled by its subscription tier (Claude Pro, Claude Max, etc.).
To switch accounts, re-run /connect and pick a different one. Your selection is persisted across sessions.
If only one account is found, the selection prompt is skipped and the plugin uses it directly.
| Problem | Solution |
|---|---|
| "Credentials not found" | Run claude to authenticate with Claude Code first |
| "Keychain is locked" | Run security unlock-keychain ~/Library/Keychains/login.keychain-db |
| "Token expired and refresh failed" | The plugin runs claude CLI to refresh automatically. If this fails, re-authenticate manually by running claude |
| Not working on Linux/Windows | Ensure ~/.claude/.credentials.json exists (or $CLAUDE_CONFIG_DIR/.credentials.json if that env var is set). Run claude to create it |
| Keychain access denied | Grant access when macOS prompts you |
| Keychain read timed out | Restart Keychain Access (can happen on macOS Tahoe) |
| "Credentials are unavailable or expired" | Run claude to refresh your Claude Code credentials |