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-cost-widget

v1.0.1

Published

Show Claude Code's session cost estimate and latest token usage in its status line.

Readme

claude-code-cost-widget

Puts Claude Code's session cost estimate and latest-response token usage in its status line.

preview

Claude session estimate $0.01234 | latest: 15500 in / 1200 out | cached 12.9%

usage

# setup
npx claude-code-cost-widget enable

# teardown
npx claude-code-cost-widget disable

Restart Claude Code if the footer doesn't appear on the next refresh. Node 20+ on macOS or Linux; no dependencies.

What enable does

  1. Copies the status-line script to ~/.claude/claude-code-cost-widget/ (or $CLAUDE_CONFIG_DIR/claude-code-cost-widget/). It lives there, not in the npx cache, so clearing the cache doesn't break the footer.
  2. Smoke-tests the copied script with the current Node binary. If that fails, settings are not touched.
  3. Sets statusLine in settings.json to run that script with the absolute path of the current Node binary. Every other setting is preserved, and the original file is backed up once to settings.json.claude-code-cost-widget-backup.

Running enable again is safe. If you upgrade or remove the Node version that was active when you enabled it (for example with nvm or mise), run enable again to point the footer at the new binary.

settings.json symlinks are followed and preserved: the resolved file is updated and the backup sits beside it. Dangling symlinks, malformed settings, and settings that change while the command runs all fail without writing.

What disable does

Restores the statusLine you had before enabling (or removes it if there was none) without touching other settings changed since. If the status line has since been replaced by something else, it's left alone. The copied scripts are removed; the backup is kept. Running disable again is safe.

What the footer shows

The session figure is Claude Code's own estimate (cost.total_cost_usd in the status-line payload), not an independent calculation or an invoice. The token counts describe only the latest response; cache reads and writes are counted once in the input total. Missing or invalid fields are shown as unavailable, never as zero. The script makes no network calls and doesn't read the transcript.

Development

npm test

Releasing

Releases are automated with release-please. Merge to main with conventional commit titles (squash-merge PRs): fix: bumps the patch version and feat: the minor (a breaking change also bumps the minor while the version is below 1.0.0). release-please keeps a release PR open with the next version and CHANGELOG.md. Merging it tags the release, creates the GitHub release, and publishes to npm from .github/workflows/release.yml using trusted publishing, so no npm token is stored.