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

tokenclaw-dev

v2.5.0

Published

See what your AI agents spend. Track Claude, OpenAI, Gemini costs. Credit pool tracking for Anthropic's June 15 billing split. Alerts and hard caps.

Readme

tokenclaw

Anthropic's Agent SDK billing split hits June 15. Know what your agents are spending before they stop.

On June 15, programmatic Claude usage (Agent SDK, claude -p, GitHub Actions, third-party apps) moves to a separate credit pool. When credits run out, automated requests hard-stop. No fallback, no rollover.

tokenclaw shows you both pools, side by side.

npm install -g tokenclaw
tokenclaw credits --set-pool 200    # your plan's credit allocation
tokenclaw credits
Credit Usage  (2026-06-01 -> 22d remaining)

Subscription (interactive)
  Claude Code              $4.9K consumed @ API rates
  Claude Desktop           $83.64 consumed @ API rates
  $5.0K consumed on a $200.00/mo plan = 25x value

Agent SDK credits
  ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░  $13.35 / $200.00 (7%)
  ├─ OpenClaw               $13.35

Projection
  Daily rate:          $1.33/day
  Month-end forecast:  $42.71
  ✓  On track to stay within $200.00 pool

No auth, no config. Reads local session logs from Claude Code, OpenClaw, Cursor, Windsurf, Cline, Roo Code, Aider, and Continue.dev.


Credit pools (new)

tokenclaw credits                               # see both pools
tokenclaw credits --set-pool 200                # set your SDK credit allocation
tokenclaw credits --set-pool 20                 # Pro plan
tokenclaw credits --set-pool 100                # Max 5x
tokenclaw credits --set-period-start 2026-06-15 # set billing cycle start
tokenclaw credits --json                        # programmatic output

Shows subscription usage (interactive, unlimited) vs Agent SDK credits (capped, metered at API rates). Projects when you'll hit your cap based on current burn rate.

| Your plan | SDK credit pool | |-----------|----------------| | Pro ($20/mo) | $20/month | | Max 5x ($100/mo) | $100/month | | Max 20x ($200/mo) | $200/month |


30-second setup

npm install -g tokenclaw
tokenclaw today

Shows what you've spent today, by tool:

  OpenClaw           $12.41
  Claude Code        $6.20

  Total              $18.61 / $50.00 (37%)

Catch runaway costs early

tokenclaw alert --daily 50

Get notified before a bad loop burns hundreds overnight. Installs a background check (runs hourly, survives reboots on macOS).

Connect Slack to get alerts when you're not watching:

tokenclaw config slack https://hooks.slack.com/services/YOUR/WEBHOOK/URL

See cost after every Claude Code turn

tokenclaw hook install

Every time Claude finishes a turn, you see:

[tokenclaw] $18.32/$50 (37%)

Hard-block a runaway agent

tokenclaw proxy                                     # start the proxy
ANTHROPIC_BASE_URL=http://localhost:4040 claude      # point agent at it
tokenclaw cap --key sk-ant-research --daily 10      # block at $10/day

At 80% the proxy warns. At 100% it returns 429 and the agent stops. Your money stops leaving.


Built for

  • Solo builders with Claude automations hitting the June 15 credit split
  • Claude Code users on Max plans burning $200+/day
  • OpenClaw / OpenRouter API users running cron agents
  • Cursor and Windsurf power users
  • Anyone who's had a surprise API bill

All commands

| Command | What it does | |---------|-------------| | tokenclaw credits | Subscription vs SDK credit usage, burn projection | | tokenclaw today | Today's spend by tool | | tokenclaw view | Full breakdown: models, projects, trends, efficiency | | tokenclaw status | One-line spend check (instant) | | tokenclaw alert --daily 50 | Alert at $50/day | | tokenclaw alert --velocity 0.50 | Alert when burning >$0.50/min | | tokenclaw hook install | Show spend after every Claude Code turn | | tokenclaw cap --key <prefix> --daily <n> | Hard-block at $n/day (needs proxy) | | tokenclaw baseline | Your spending patterns by day-of-week | | tokenclaw list sessions | Most expensive sessions | | tokenclaw digest | Daily Slack summary | | tokenclaw mcp install | Let AI agents check their own budget |


Advanced

tokenclaw alert --velocity 0.50

Alerts on spend rate over a 30-minute window from proxy data. Catches runaway loops before they hit the total threshold.

tokenclaw baseline

After 7+ days, shows per-day-of-week patterns (median, P95). After 14 days, anomaly detection replaces the default spike threshold with one tuned to your actual spend. API-billed tools only.

tokenclaw digest --install

Sends yesterday's spend summary to Slack at 9 AM daily (macOS launchd).

tokenclaw mcp install

Gives Claude Code access to three tools: get_budget_status, get_session_cost, estimate_cost. Agents can check their budget before expensive operations and switch to cheaper models when running low.

Add to your project's CLAUDE.md:

## Cost awareness
Before expensive operations, check budget via the tokenclaw MCP server.
If remaining budget is <20%, prefer Sonnet over Opus for routine tasks.

Add to ~/.claude/settings.json:

{
  "hooks": {
    "Stop": [{ "matcher": "", "hooks": [{ "type": "command", "command": "npx tokenclaw status --oneliner 2>/dev/null || true" }] }]
  },
  "mcpServers": {
    "tokenclaw": { "command": "npx", "args": ["tokenclaw", "mcp"] }
  }
}

Caps require the proxy (tokenclaw proxy). The proxy sits between your agent and the API, counts tokens, and blocks when a cap is hit.

tokenclaw cap --key sk-abc --weekly 500
tokenclaw cap --key sk-abc --monthly 2000
tokenclaw cap                               # view all caps
tokenclaw cap --clear --key sk-abc          # remove a cap

Auto-detects provider: /v1/messages goes to Anthropic, /v1/chat/completions goes to OpenAI.


Config

tokenclaw config                            # show current config
tokenclaw config slack <url>                # set Slack webhook
tokenclaw config reset                      # reset to defaults

Uninstall

npm uninstall -g tokenclaw
rm -rf ~/.tokenclaw

License

MIT