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-subscription-provider

v1.0.0

Published

Claude Code subscription provider for pi plus a subscription-compatible network interceptor

Readme

Claude Code network interceptor

Lokální MITM proxy pro claude / Claude Code, která funguje i se subscription auth.

  • nevyžaduje ANTHROPIC_API_KEY
  • zachytí requesty přes HTTPS_PROXY
  • vygeneruje vlastní CA a předá ji Claude přes NODE_EXTRA_CA_CERTS
  • ukládá request/response hlavičky i těla do souborů
  • umí běžet jako sidecar nebo rovnou spustit claude

Instalace

npm install

Rychlý test

npm run demo:hello

To spustí interceptor a přes něj:

claude --print "Hello world"

Sidecar režim

Terminál A:

npm run interceptor

Interceptor vypíše cestu k env souboru, typicky:

source /.../.claude-interceptor.env
claude -p "Hello world"

Terminál B:

source ./.claude-interceptor.env
claude -p "Hello world"

Logy

Vše se ukládá do logs/:

  • logs/transactions.ndjson – jedna HTTP transakce na řádek
  • logs/events.ndjson – connect/error/start eventy
  • logs/bodies/ – request/response těla

Co v logu uvidíš

Např. pro claude -p "Hello world" jsem ověřil requesty na:

  • https://api.anthropic.com/v1/messages?beta=true
  • https://api.anthropic.com/v1/mcp_servers?limit=1000
  • https://ui.sh/mcp?agent=claude
  • https://mcp-proxy.anthropic.com/...
  • https://downloads.claude.ai/...
  • https://http-intake.logs.us5.datadoghq.com/api/v2/logs

Poznámky

  • Hlavičky jako Authorization jsou defaultně redigované.
  • Pokud chceš vidět i secrety, spusť s --no-redact.
  • Těla se ukládají maximálně do velikosti --body-limit-bytes na request/response.

Pi provider: claude-code-subscription-provider

Repo je zároveň installable jako pi package a obsahuje project-local pi extension:

  • .pi/extensions/claude-code-subscription-provider/index.ts

Co dělá:

  • registruje sadu modelů (pi id → Anthropic id):
    • claude-code-subscription-provider/opus-5claude-opus-5
    • claude-code-subscription-provider/opus-4-8claude-opus-4-8
    • claude-code-subscription-provider/opus-4-7claude-opus-4-7
    • claude-code-subscription-provider/opus-4-6claude-opus-4-6
    • claude-code-subscription-provider/sonnet-4-6claude-sonnet-4-6 (256k — subscription tier nemá 1M na Sonnetu)
  • 1M long-context beta (context-1m-2025-08-07) posílá jen u modelů s 1M oknem (Opus). U Sonnetu se vynechává — jinak Anthropic vrací 429 Usage credits are required for long context requests i na malém promptu.
  • pro requesty používá Anthropic Messages API a u všech modelů vynutí adaptive thinking (compat.forceAdaptiveThinking)
  • thinkingLevelMap kopíruje nativní pi-ai katalog: Opus 4.6 mapuje xhigh → "max", novější Opus modely xhigh → "xhigh", Sonnet 4.6 jede na defaultu
  • pro Opus 4.7+ a Fable 5 automaticky nastaví thinking.display = "summarized" (defaultně skrývají thinking text, což by v UI vypadalo jako prázdná pauza před odpovědí); Opus 4.6 a Sonnet 4.6 thinking ukazují nativně
  • access token získá přes lokálně spuštěný claude (Claude Code) a MITM capture (probe běží na claude-opus-4-8)
  • podporuje běžné claude auth login --claudeai i setup token předaný přes CLAUDE_CODE_OAUTH_TOKEN
  • token ukládá s právy 0600 do ~/.pi/agent/cache/claude-code-subscription-provider.json
  • při neplatném cached tokenu udělá refresh a request zopakuje
  • když Claude Code není přihlášené, vypíše instrukci k claude auth login --claudeai

Instalace user-level z repozitáře:

pi install git:[email protected]:Krystofee/claude-code-subscription-provider.git

Použití v pi:

pi

Pak v pi (vyber libovolný model ze sady):

/model claude-code-subscription-provider/opus-5
/model claude-code-subscription-provider/opus-4-8
/model claude-code-subscription-provider/opus-4-7
/model claude-code-subscription-provider/opus-4-6
/model claude-code-subscription-provider/sonnet-4-6   # 256k context

Volitelně lze zkontrolovat nebo refreshnout cache:

/claude-code-auth
/claude-code-auth refresh

Příklady

Spustit jen proxy:

node src/claude-network-interceptor.js

Spustit přímo Claude přes proxy:

node src/claude-network-interceptor.js --exec claude -- --print "Hello world"