griffinmartin/opencode-claude-auth
OpenCode 2 plugin that uses your existing Claude Code credentials — no separate login needed.
What it solves
This project allows users of the OpenCode 2 editor to authenticate with Anthropic’s API using their existing Claude Code subscription credentials. It eliminates the need to manage separate API keys or pay for additional usage if you are already a Claude Code subscriber.
How it works
The plugin acts as an authentication provider that reads OAuth tokens directly from your system's secure storage (macOS Keychain or local credential files). Once connected, it hooks into OpenCode's native Anthropic integration to inject your subscription identity, handle token refreshes automatically, and manage necessary API header translations (such as tool name mapping and beta flag management) to ensure compatibility with Claude's models.
Who it’s for
It is designed for developers who use OpenCode 2 and already have an active Claude Code subscription, providing a seamless way to use their existing account for AI-assisted coding without manual key management.
Highlights
- Zero-key setup: Uses your existing Claude Code OAuth credentials directly from your system keychain.
- Automatic Refresh: Handles token rotation automatically without requiring manual re-authentication.
- Multi-account support: Automatically detects and allows selection between multiple Claude Code accounts on macOS.
- Native Integration: Leverages OpenCode 2's built-in Anthropic provider for reliable streaming and prompt conversion.
Related
- Project
- Project
- Project
- Dispatch
- Project