OpenCode auth plugin: native Claude OAuth account manager (duh-claude-oauth protocol) + vendored opencode-claude-auth chat path. /claude use|list|status.
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-02 20:04:36 +02:00
scripts fix: real cch body-hash signing, obfuscate tool names, logout fallback 2026-10-02 20:04:36 +02:00
test fix: real cch body-hash signing, obfuscate tool names, logout fallback 2026-10-02 20:04:36 +02:00
vendor fix: real cch body-hash signing, obfuscate tool names, logout fallback 2026-10-02 20:04:36 +02:00
.gitignore refactor: hand-rewrite vendor, fix 429 rotation and active persist 2026-09-17 13:47:47 +02:00
index.js fix: real cch body-hash signing, obfuscate tool names, logout fallback 2026-10-02 20:04:36 +02:00
package.json fix: real cch body-hash signing, obfuscate tool names, logout fallback 2026-10-02 20:04:36 +02:00
README.md fix: bump spoofed claude-cli version to 2.1.280 for opus-5-5 2026-09-23 02:38:55 +02:00

duh-claude-auth

Native Claude OAuth provider for OpenCode. Manages a pool of accounts with an account-first manager, auto-refreshes tokens before they expire, and sends the full claude-cli header set (betas, user-agent, stainless headers) on every request.

Install

git clone <repo-url>

opencode.jsonc:

{ "plugin": ["file:<clone-dir>/duh-claude-auth"] }

Restart opencode. No install, no build, zero deps.

Accounts

~/.config/opencode/duh-claude-accounts.json — plugin-private store:

{ "version": 1, "active": "you@gmail.com", "accounts": [ ... ] }

The active account is mirrored into ~/.local/share/opencode/auth.json. auth.json is the session source of truth.

Commands

Command Effect
/claude or /claude list list accounts, active marker, token TTL
/claude use acc2|email switch active account (refreshes first)
/claude status [acc] subscription + quota usage windows

Env

  • DUH_CLAUDE_REDIRECT_PORT (default 54321)
  • ANTHROPIC_CLI_VERSION (default 2.1.280, used in User-Agent)