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

tokenburn-cli

v0.2.5

Published

htop for your AI spending

Readme

tokenburn

Stop guessing where your AI coding budget goes. tokenburn is a free, open-source CLI that analyzes spending across every major AI coding tool, detects waste with 30 rules, and tells you exactly how to fix it.

npm version license tests

Why tokenburn

  • Your $200/mo plan might be hiding $3,197 in API-equivalent usage -- and most of it is waste you can eliminate with config changes.
  • 30 detection rules find duplicate requests, model overuse, retry storms, context drift, and 26 other patterns that silently drain your budget.
  • One command fixes it. tokenburn scan --fix writes optimizations directly into your CLAUDE.md.

Quick Start

npm install -g tokenburn-cli
tokenburn            # auto-detects your tools, runs first-time setup wizard
tokenburn scan       # find waste

Zero Config

tokenburn auto-detects installed tools and reads their local logs directly. No proxy, no API keys, no setup for:

| Auto-detected | Via Proxy (catches everything else) | |---|---| | Claude Code, Cline, Pi, Codex CLI, Gemini CLI, Roo Code, OpenCode | Cursor, aider, Windsurf, Copilot, Continue, any tool |

First run triggers a setup wizard that detects your tools, asks if you're on a subscription or API billing, and configures everything.

What It Detects

Real output from a Max Plan subscriber ($200/mo). Seven days of Claude Code usage:

$ tokenburn scan --last 7d

  tokenburn waste scan — 7 days, 1,847 requests

  API-equivalent cost: $3,197.40   (14.9x plan value)
  Waste detected:     $1,082.16   (33.8%)

  CRITICAL
  ┌─────────────────────────────────────────────────────────┐
  │ duplicate-requests        217 hits     $428.60 wasted   │
  │ Same file read 2-11x per session. Agent re-reads files  │
  │ it already has in context.                              │
  │ → tokenburn scan --fix to patch CLAUDE.md               │
  ├─────────────────────────────────────────────────────────┤
  │ model-overuse             183 hits     $312.40 savable  │
  │ Short tasks (<200 tokens output) routed to Opus.        │
  │ → Switch to Haiku for trivial completions               │
  ├─────────────────────────────────────────────────────────┤
  │ retry-storm                14 hits      $89.20 wasted   │
  │ Same failing request retried 3-8x without changes.      │
  │ → Add error-handling instructions to CLAUDE.md          │
  └─────────────────────────────────────────────────────────┘

  WARNING
  ┌─────────────────────────────────────────────────────────┐
  │ low-cache-hit             cache rate: 6.2%    -$118.30  │
  │ context-drift             38 sessions          -$67.40  │
  │ write-rewrite             29 cycles            -$41.80  │
  │ read-heavy                12 sessions          -$24.46  │
  └─────────────────────────────────────────────────────────┘

  Potential savings: $1,082.16/week
  Run: tokenburn scan --fix     (interactive — patches CLAUDE.md)
  Run: tokenburn optimize --simulate   (model what-if analysis)

vs Alternatives

| | tokenburn | ccusage | BurnRate | Tokscale | |---|---|---|---|---| | Price | Free / MIT | Free / MIT | $12/mo | Contact sales | | Shows spending | Yes | Yes | Yes | Yes | | Detects waste | 30 rules | -- | 3 rules | Custom | | Fix suggestions | Yes + auto-apply | -- | -- | Manual | | Tools supported | 14+ (adapter + proxy) | Claude Code only | Claude Code only | API only | | Runs locally | Yes | Yes | Cloud | Cloud | | MCP server | Yes | -- | -- | -- |

ccusage tells you how much you spent. tokenburn tells you how much you wasted and how to stop.

Commands

| Command | What it does | |---|---| | tokenburn | Auto-detect tools, import logs, show today's report | | tokenburn scan | Run 30 waste detection rules | | tokenburn scan --fix | Interactive mode -- apply fixes to CLAUDE.md | | tokenburn optimize | Generate optimization plan | | tokenburn optimize --simulate | Model cost savings with different configs | | tokenburn report | Cost breakdown (today, --last 7d, --by model) | | tokenburn live | Real-time spending dashboard | | tokenburn tree | Visualize agent cost tree | | tokenburn proxy start -d | Start local proxy for universal tool support | | tokenburn dashboard | Open web dashboard at localhost:10812 |

Supported Tools

Native log adapters (zero config)

| Tool | Log format | Status | |---|---|---| | Claude Code | JSONL | Stable | | Cline | JSONL | Stable | | Codex CLI | JSONL | Stable | | Gemini CLI | JSONL | Stable | | Roo Code | JSONL | Stable | | OpenCode | JSONL | Stable | | Pi | JSONL | Stable |

Proxy (catches everything else)

Start the proxy once, and any tool that supports ANTHROPIC_BASE_URL or OPENAI_BASE_URL is tracked automatically:

tokenburn proxy start -d
eval $(tokenburn proxy env)

Works with Cursor, aider, Windsurf, Copilot, Continue, and any custom agent using Anthropic/OpenAI SDKs.

Your tool → localhost:10811 → tokenburn (record) → api.anthropic.com
                                   ↓
                            ~/.tokenburn/tokenburn.db

All data stays on your machine. Nothing is sent anywhere.

MCP Server

Let your AI agent monitor its own spending mid-session:

tokenburn mcp   # stdio transport
{ "mcpServers": { "tokenburn": { "command": "tokenburn", "args": ["mcp"] } } }

Exposes get_spending, get_waste, get_suggestion, and get_tree tools.

License

MIT -- see LICENSE.

"tokenburn" is a trademark of its author. The MIT license grants rights to the code, not the name.