npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-anthropic-oauth

v0.4.1

Published

OpenCode plugin for Anthropic Claude Pro/Max OAuth login — no Claude Code needed.

Downloads

4,791

Readme

opencode-anthropic-oauth

OpenCode plugin for Anthropic Claude Pro/Max OAuth login — no Claude Code needed.

What it does

Lets you authenticate with your Claude Pro/Max subscription directly in OpenCode via browser OAuth. No need to install Claude Code or manage credentials files.

Installation

npm install -g opencode-anthropic-oauth

Then add to your opencode.json:

{
  "plugin": ["opencode-anthropic-oauth"]
}

Usage

  1. Run /connect in OpenCode (or oc auth login from CLI)
  2. Select Anthropic > Claude Pro/Max
  3. Open the link in your browser and authorize
  4. Paste the code back into OpenCode
  5. Done — all Anthropic models are now available

How it works

  • Implements the OAuth PKCE flow directly against Anthropic's auth endpoints
  • Opens your browser for authentication — you log in with your Claude account
  • Exchanges the authorization code for access + refresh tokens
  • Auto-refreshes tokens when they expire — no manual re-auth needed
  • Sets the required API headers on Anthropic requests
  • Preserves prompt caching for efficient token usage

Changelog

0.4.1

  • Fixed high token consumption — removed cache_control stripping that was disabling prompt caching
  • Added x-anthropic-billing-header for proper token tracking
  • Aligned beta flags with official Claude CLI plugin

0.4.0

  • Added ?beta=true URL parameter for OAuth compatibility
  • Injected system identity prefix for claude-code beta
  • Stripped cache_control (now removed in 0.4.1)

0.3.0

  • Added auto token refresh via loader hook
  • Background proactive refresh timer (5min intervals)

Environment variable overrides

All OAuth parameters can be overridden via environment variables. If Anthropic changes something before we publish an update, set an env var and keep working:

| Variable | Description | |---|---| | ANTHROPIC_CLIENT_ID | OAuth client ID | | ANTHROPIC_CLI_VERSION | Claude CLI version for User-Agent | | ANTHROPIC_USER_AGENT | Full User-Agent string (overrides version) | | ANTHROPIC_AUTHORIZE_URL | OAuth authorization endpoint | | ANTHROPIC_TOKEN_URL | OAuth token endpoint | | ANTHROPIC_REDIRECT_URI | OAuth redirect URI | | ANTHROPIC_SCOPES | OAuth scopes | | ANTHROPIC_BETA_FLAGS | Anthropic beta feature flags |

Example:

export ANTHROPIC_CLI_VERSION=2.2.0

Disclaimer

This plugin uses Anthropic's public OAuth client ID to authenticate. Anthropic's Terms of Service (February 2026) state that Claude Pro/Max subscription tokens should only be used with official Anthropic clients. This plugin exists as a community workaround and may stop working if Anthropic changes their OAuth infrastructure. Use at your own discretion.

License

MIT