Claude Auth
이 내용은 아직 번역본이 없습니다.
Claude Auth registers its own Anthropic auth provider with a custom fetch handler that intercepts all Anthropic API requests, using your Claude Code credentials.
Key features
| Feature | Description |
|---|---|
| No separate API key | Reuses OAuth tokens from your Claude Code installation |
| Keychain-first | Reads from macOS Keychain; falls back to ~/.claude/.credentials.json ($CLAUDE_CONFIG_DIR respected) on other platforms |
| 30-second TTL cache | Tokens cached in memory; near-expiry tokens refresh via the Anthropic OAuth endpoint (zero LLM tokens consumed) |
| Multi-account (macOS) | Multiple Claude Code accounts detected automatically; switch via opencode auth login |
| auth.json fallback | Syncs credentials to OpenCode auth.json; on Windows writes both known locations |
| Background re-sync | Every 5 minutes; falls back to the Claude CLI if direct refresh fails |
Prerequisites
- Claude Code installed and authenticated (run
claudeat least once) - OpenCode installed
- macOS preferred (Keychain); Linux and Windows work via the credentials file fallback
Installation
Add the plugin to ~/.config/opencode/opencode.json:
{
"plugin": ["opencode-claude-auth@latest"]
}