Opencode Anthropic Auth Fix banner
iamtheavoc1 iamtheavoc1

Opencode Anthropic Auth Fix

Development community

Description

One-command OpenCode fix for Anthropic subscription billing. Installs @ex-machina/opencode-anthropic-auth, patches self-healing auth recovery, and rewrites opencode.json so OpenCode uses your Claude Pro/Max session without the misleading 'out of extra usage' error.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

opencode-anthropic-auth-fix

The repo name is historical. Today this project is a **general-purpose Anthropic OAuth repair and refresh toolkit for OpenCode + Claude Code users**.

It does two jobs:

  1. fixes the OpenCode request-shape problem that causes the misleading "You're out of extra usage" error
  2. keeps Anthropic OAuth tokens usable with a manual flow, a recurring local flow, or a remote VPS-offload flow

The short version

If you want a one-time/manual setup:

bash ./install.sh --mode=manual

If you want local recurring refresh while your machine is awake:

bash ./install.sh --mode=recurring-local

If you want refresh to keep running while your laptop sleeps or is shut down, follow:

If you want **OpenCode itself** to keep running while your Mac is closed, use:

First-time requirement

If you have never logged into Claude Code on this machine, do this once first:

claude auth login

After that, run one of the install commands above.

What gets installed

The installer writes runtime helpers to:

~/.local/share/opencode-anthropic-auth/

Main helpers:

  • doctor.mjs — inspect, refresh, or auto-fix auth state
  • recover.sh — walk through one-time recovery after a dead token chain
  • reset.sh — delete the stored Anthropic OAuth entry for a clean slate
  • refresh-token.mjs — recurring local refresher
  • pull-from-vps.sh — on-demand pull when VPS-offload mode is enabled

Repo-level convenience wrappers:

  • ./install.sh
  • ./doctor.sh
  • ./reset.sh

Three supported approaches

1) Manual mode

Best when you want zero background jobs.

Install:

bash ./install.sh --mode=manual

What it does:

  • installs the OpenCode fix
  • installs doctor.mjs, recover.sh, and reset.sh
  • installs the claude() shell wrapper
  • does not install LaunchAgent / cron

Use it