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

@winston.wan/burn-your-money

v3.0.4

Published

💸 Burn Your Money - 实时显示 Claude Code 的 token 消耗,看着你的钱包燃烧!

Readme

💸 Burn Your Money

"看着你的存款实时归零。"

NPM Version License

一个为 Claude Code 准备的状态栏插件。它能让你实时看到每一秒花了多少钱——因为知情是痛苦的第一步。


📸 效果预览

预览


🔥 为什么要用?

Claude Code 很好用,就像在你的命令行里装了一个核动力引擎。但是每次它思考的时候,我都仿佛听到了碎钞机的声音。

这就诞生了 Burn Your Money。它能在你的状态栏显示:

  • 实时烧钱速度:精准显示每秒烧掉多少 token,让你的每一次回车都充满罪恶感
  • 今日战绩:看看今天又给 Anthropic 贡献了几杯咖啡
  • 历史总计:累计伤害。建议心脏不好的人不要开启此功能

🚀 安装

npm install -g "@winston.wan/burn-your-money"

重启 Claude Code 即可看到效果。


⚙️ 配置

修改 ~/.claude/burn-your-money-config.json 自定义你的痛苦程度:

{
  "theme": "fire",          // 主题: fire, ocean, forest, golden
  "alert_daily": 10.0,      // 每日预警金额(美元)
  "show_burn_rate": true    // 是否显示燃烧速度
}

主题说明

| 主题 | 风格 | |------|------| | fire | 红色火焰风格 | | ocean | 蓝青海洋风格 | | forest | 绿色森林风格 | | golden | 金色奢华风格 |


📊 使用命令

Claude Code 内置命令

在 Claude Code 对话中可以直接使用:

| 命令 | 说明 | |------|------| | /burn-your-money | 查看详细账单(今日/周/月/总计 + 有趣统计) | | /burn-your-money-stats | 查看 token 使用趋势图 | | /burn-your-money-export | 导出 token 数据(CSV 格式) | | /burn-your-money-uninstall | 完全卸载插件(推荐使用此命令卸载) |


🛠️ 技术特点

纯 Node.js 实现

  • 零外部依赖 - 只需要 Node.js(Claude Code 自带)
  • 无 bash 问题 - 不会有 Windows fork 错误
  • 跨平台稳定 - Windows/macOS/Linux 无差异
  • 执行速度快 - 无需启动 bash 子进程

数据来源

  • 当前会话:从 Claude Code statusline API 实时获取
  • 历史统计:从 ~/.claude/stats-cache.json 读取
  • 本地计算:零网络请求,纯本地处理

💰 价格说明

费用计算基于 Claude 模型官方定价(截至 2025 年):

| Token 类型 | 价格 | |-----------|------| | Input Tokens | $3 / 百万 tokens | | Output Tokens | $15 / 百万 tokens | | Cache Read Tokens | $0.30 / 百万 tokens (90% 折扣) |

注意:如果你使用的是其他兼容模型(如本地部署的模型),实际费用可能不同。本插件仅按 Claude 官方价格估算,不代表实际账单。


📋 常见问题

1. Token 统计和 /stats 不一致?

本插件统计包含所有类型的 token(输入、输出、缓存读取)。Claude Code 内置的 /stats 命令可能只显示"完整价格"的 tokens(输入 + 输出),不包含享受 90% 折扣的缓存读取 tokens。

示例对比:

  • 本插件:3.93B tokens(包含缓存)
  • /stats188M tokens(不含缓存)

2. 费用计算准确吗?

  • 当前会话费用:完全准确,使用 Claude Code 提供的实时数据
  • 历史费用统计:基于固定费率估算(Input $3/M, Output $15/M, Cache Read $0.3/M),如果频繁切换不同模型,可能略有偏差

3. 卸载后状态栏还显示?

npm 的 postuninstall 钩子在某些情况下可能不触发。如果卸载后状态栏还显示:

手动清理方法

# 删除插件文件
rm -f ~/.claude/statusline.js
rm -f ~/.claude/scripts/token-history.js
rm -f ~/.claude/commands/burn-your-money-*.md

# 编辑 ~/.claude/settings.json,删除 statusLine 配置项

然后重启 Claude Code。


🗑️ 卸载

推荐方式:在 Claude Code 中使用自定义命令

/burn-your-money-uninstall

这个命令会自动删除所有插件文件和配置。

备选方式:使用 npm 卸载(可能需要手动清理)

npm uninstall -g "@winston.wan/burn-your-money"

如果卸载后状态栏仍然显示,请参考常见问题中的手动清理方法。


😄 免责声明

本插件并不能通过任何技术手段减少你的 Token 消耗,它只能(显著地)升高你的血压。

享受燃烧的感觉吧。🔥