Fixes the rate limit (429) and "out of extra usage" / "no credit" errors when using Claude Pro/Max subscription models (Sonnet, Opus, Haiku) in opencode.
After installing, restart opencode → /connect → Claude Pro/Max → authorize in browser → paste the code.
curl -sL https://raw.githubusercontent.com/vinzabe/opencode-anthropic-max-fix/master/install.cjs | node- Installs the correct
op-anthropic-auth@0.1.1plugin with OAuth billing-header support, into both opencode plugin layouts (~/.cache/opencode/node_modules/...and~/.cache/opencode/packages/<spec>/...) - Pins the plugin in
~/.config/opencode/opencode.json - Sets up a per-platform watcher that restores the plugin if opencode overwrites it via
bun install- Linux: systemd
path+serviceuser units - macOS: launchd agent with
WatchPaths(kqueueNOTE_WRITE)
- Linux: systemd
- Node.js
- macOS or Linux
- Claude Max or Pro subscription
# Linux
systemctl --user disable --now opencode-anthropic-patch.path opencode-anthropic-patch.service
rm ~/.config/systemd/user/opencode-anthropic-patch.{service,path}
# macOS
launchctl unload ~/Library/LaunchAgents/com.vinzabe.opencode-anthropic-patch.plist
rm ~/Library/LaunchAgents/com.vinzabe.opencode-anthropic-patch.plistcurl -sL https://raw.githubusercontent.com/vinzabe/opencode-anthropic-max-fix/master/install.cjs | node -- --no-watcher