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: 5/3/2026
{
"issues": [
{
"type": "npm-audit",
"message": "@opencode-ai/plugin: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "effect: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "uuid: uuid: Missing buffer bounds check in v3/v5/v6 when buf is provided",
"severity": "medium"
}
],
"status": "PASSED",
"scannedAt": "2026-05-03T06:26:38.718Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}See how opencode-claude-auth compares with popular alternatives.
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,322 GitHub stars.
Yes. opencode-claude-auth passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
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. SkillsLLM 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
Based on votes and bookmarks from developers who liked this skill
From $49 · 30 days · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
See comparison
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 |
opencode-claude-auth@2.2.1 |
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": ["opencode-claude-auth@2.2.1"]
}
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 |