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

claude-code-auth

v2.7.2

Published

Claude Code subscription auth provider for OpenCode and Claude Code — multiple Claude accounts via OAuth, with subscription rate limits exposed to OpenCode.

Readme

claude-code-auth

npm version npm downloads CI

A core-auth provider that signs in to Claude with the real Claude Code OAuth flow and lets you add multiple Claude subscription accounts. Both Claude Code (via the loader proxy) and OpenCode route requests through it, rotating accounts and respecting each one's subscription rate limits — so OpenCode uses your Claude Code subscription instead of a pay-per-token API key.

Under-the-Hood Architecture

flowchart TD
    subgraph Driver [claude-code driver — thin layer on core-auth]
        HANDLE["handle(request) — Anthropic request rewrite"]
        LOGIN["loginFlow() — PKCE OAuth"]
    end
    subgraph Core [core-auth]
        MGR[AccountManager: select / refresh / rotate]
        STORE[(accounts.json)]
        MGR <--> STORE
    end
    CC[Claude Code loader proxy] -->|dist/handler.js handle| HANDLE
    OC[OpenCode loader] -->|loader.fetch| HANDLE
    HANDLE -->|acquire account + token| MGR
    HANDLE -->|"Bearer + anthropic-beta: oauth + Claude Code system block"| API[(api.anthropic.com)]
    API -->|429 / 529| MGR
    LOGIN -->|platform.claude.com OAuth| STORE

Structure

  • src/
    • driver/ — driver + OAuth config/login (request prep now round-trips through core-ir, java/claude-provider)
    • oauth/ — PKCE flow
    • commands.ts — slash-commands
    • handler.ts/index.ts/cli.ts — entries
  • dist/
    • index.js — OpenCode bundle
    • handler.js — Claude loader bundle
    • cli.js — CLI bundle

Installation

Via plugin-updater (recommended)

npx plugin-updater@latest init https://github.com/intisy-ai/claude-code-auth

Via npm

npm install claude-code-auth

Configuration

Config file: <configDir>/config/claude-code.json (edit via the loader or /claude-code-config set).

{
  "logging": true,
  "max_account_attempts": 4,
  "account_selection_strategy": "hybrid",
  "default_cooldown_seconds": 60,
  "max_cooldown_seconds": 900
}

| Key | Default | | --- | --- | | logging | true | | max_account_attempts | 4 | | account_selection_strategy | "hybrid" | | default_cooldown_seconds | 60 | | max_cooldown_seconds | 900 |

Commands

| Command | Description | Arguments | | --- | --- | --- | | /claude-code-auth-config | View and change claude-code-auth configuration | list | get <key> | set <key> <value> | | /claude-accounts | List signed-in Claude subscription accounts | |

Dependencies

  • core
  • core-auth
  • sync-bridge

Logging

Logs are written to <configDir>/logs/YYYY-MM-DD/claude-code-auth-HH-MM-SS.log and are toggled by this plugin's logging config (default on). Console mirroring is global, off by default, and controlled by the shared config/settings.json logConsole flag.

License

MIT.