@thehugeman/opencode-anthropic-auth-community
v0.0.3
Published
> Community-maintained Anthropic Claude Pro/Max OAuth plugin for [opencode](https://github.com/anomalyco/opencode).
Maintainers
Readme
opencode-anthropic-auth-community
Community-maintained Anthropic Claude Pro/Max OAuth plugin for opencode.
The official opencode-anthropic-auth package was removed from npm following a legal request from Anthropic. This is a community fork to keep the functionality alive.
Disclaimer: Using this plugin may violate Anthropic's Terms of Service. Use at your own risk.
Installation
Add the plugin to your opencode.json:
{
"plugin": ["@thehugeman/opencode-anthropic-auth-community@latest"]
}That's it. No custom binary, no fork of opencode — works with the standard installed opencode CLI.
Usage
- Run
opencode - Go to Providers → Login → Anthropic
- Select Claude Pro/Max
- A browser URL will open — authorize it, then paste the code back into the terminal
- Done — your Claude Pro/Max subscription is now used by opencode at no extra API cost
Optional: Full system prompt
If you're on opencode >= 1.2.27, you can add the original Anthropic session prompt by creating an anthropic-prompt.txt file in your opencode plugins directory:
~/.config/opencode/plugins/anthropic-prompt.txtContents from the original prompt.
How it works
The plugin intercepts Anthropic API requests and:
- Handles OAuth PKCE flow via
claude.ai - Injects the required
oauth-2025-04-20beta header - Handles token refresh automatically
- Prefixes tool names with
mcp_(required by the OAuth API path) - Strips the prefix back from streaming responses
- Computes the required billing header
Contributing
PRs welcome. If the plugin breaks (Anthropic can change their OAuth flow at any time), open an issue or submit a fix.
License
MIT
