Agent skill · software engineering · aradotso
opencode-claude-auth
opencode-claude-auth — an agent skill for coding agents.
Why this skill is useful
Adds a self-contained authentication plugin that enables seamless access to the Anthropic API without needing a separate API key, enhancing integration capabilities.
What it needs
Requires opencode installed locally. About 4k tokens when loaded. Last updated 2026-07-09. 70 stars on the source repository.
What this skill does
bash npm install -g opencode-claude-auth json { "plugin": ["opencode-claude-auth"] } Fetch https://raw.githubusercontent.com/griffinmartin/opencode-claude-auth/main/installation.md and follow every step exactly as written. bash Override CLI version if Anthropic updates their API before a new plugin release export ANTHROPICCLIVERSION=2.2.0 Override full user agent export ANTHROPICUSERAGENT="claude-cli/2.2.0 (external, cli)" Override beta flags export ANTHROPICBETAFLAGS="claude-code-20250219,oauth-2025-04-20" claude-3-haiku-20240307 claude-haiku-4-5 claude-haiku-4-5-20251001 claude-opus-4-0 claude-opus-4-1 claude-opus-4-1-20250805 claude-opus-4-20250514 claude-opus-4-5 claude-opus-4-5-20251101 claude-opus-4-6 claude-sonnet-4-0 claude-sonnet-4-20250514 claude-sonnet-4-5 claude-sonnet-4-5-20250929 claude-sonnet-4-6 bash npm run test:models json { "model": "claude-sonnet-4-5", "plugin": ["opencode-claude-auth"], "experimental": { "chat": { "system": { "transform": true } } } } typescript // The plugin registers an auth loader that intercepts Anthropic requests: // - Reads OAuth token from Keychain or credentials file // - Caches in memory with 30s TTL // - Sets Authorization: Bearer <token> // - Injects required headers: // x-api-key, anthropic-version, anthropic-beta, user-agent, x-stainless- // - Translates tool names: OpenCode uses mcp prefix, API does not // - Buffers SSE streams at event boundaries for safe translation // - Retries on 429/529 with exponential backoff + retry-after header // - Runs claude CLI to refresh tokens expiring within 60s // - Syncs to auth.json every 5 minutes as fallback // - On Windows: writes to both %USERPROFILE%\.local\share\opencode\auth.json // and %LOCALAPPDATA%\opencode\auth.json bash cat ~/.claude/.credentials.json bash security unlock-keychain ~/Library/Keychains/login.keychain-db bash claude # triggers OAuth refresh, plugin picks up new token within 30s bash 1. Authenticate Claude Code claude 2. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aradotso/opencode-claude-auth