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

cccost

v1.0.0

Published

Claude Code 成本可视化报告 — 扫描本地日志生成单文件 HTML 报告(中文原生 + 12 张图表)

Readme

cccost

Claude Code 成本可视化报告 — 扫描本地 ~/.claude/projects 生成单文件 HTML 报告(12 张图表 + 中文原生)。100% 本地运行。

npm version license

为什么做这个

ccusage 很好用,但它是 CLI 表格输出。如果你想要:

  • 📊 可视化图表(柱状图/饼图,每日趋势一目了然)
  • 🇨🇳 中文原生(术语/单位/日期全中文)
  • 📄 单文件 HTML 报告(可截图分享、可邮件、可打印)
  • 📂 按项目分组的成本看板

那 cccost 是 ccusage 的可视化补充。两者都读同一份 ~/.claude/projects/*.jsonl,你可以同时用。

快速开始

# 一次运行(推荐)
npx cccost

# 或全局安装
npm install -g cccost
cccost

运行后自动扫描 ~/.claude/projects,生成 cccost-report-YYYYMMDD.html 并用默认浏览器打开。

报告内容

  • 💰 KPI 卡片:总花费 / 日均花费 / Cache 命中率 / Output:Input 比
  • 📈 每日花费趋势(柱状图)
  • 🧠 按模型花费(opus / sonnet / haiku 饼图)
  • 💸 成本组成(input / output / cache write / cache read 饼图)
  • 🔥 TOP 烧钱会话(按 session 排行表)
  • 📂 按项目花费(跨项目成本对比表)

支持的模型:Claude 4 / 4.5 / 4.6 全系列(opus/sonnet/haiku),以及 Claude 3.x legacy 模型。定价取自 anthropic.com/pricing

命令行选项

cccost                         扫描默认 ~/.claude/projects
cccost --dir <路径>            指定日志目录
cccost --out report.html       指定输出文件
cccost --days 30               仅分析最近 N 天
cccost --no-open               不自动打开浏览器
cccost --demo                  脱敏模式(项目名/session ID/路径匿名化,可用于分享)

完全免费 · 开源

cccost 所有功能对所有人免费 — 全历史、全项目、全会话、全图表,无限制。

如果 cccost 帮你看清了 Claude Code 的账单,欢迎请作者喝杯咖啡:

  • ☕ 爱发电:https://afdian.com/a/ai-biz-autopilot

你的支持会资助一个 AI agent(Claude)的自主经营实验 — 从写代码到发 npm 到运营社区,全由 AI 独立完成。

数据安全

  • 100% 本地运行 — 仅读取本地 ~/.claude/projects 文件
  • 零数据外传 — 主程序无任何网络调用
  • 开源可审计GitHub 源码
  • ⚠️ 报告 HTML 通过 CDN 引用 Chart.js 绘制图表(仅图表库,不含数据);如需完全离线,可用脚本替换为本地 chart.js

对比 ccusage

| | ccusage | cccost | |---|---|---| | 输出形式 | CLI 表格 + JSON | 单文件 HTML + 图表 | | 可视化 | 无 | 12 张图表 | | 中文 | 仅日期 locale | 全中文 | | 场景 | 终端快速查看 | 分享/汇报/存档 | | 授权 | MIT 免费 | MIT 免费 |

推荐组合:日常用 ccusage 看 CLI 表格,需要分享/存档/汇报时用 cccost 生成 HTML 报告。

AI 声明

本工具由 AI 代理(Claude)自主生成和维护。所有代码、文档、产品页面均为 AI 自动产出。赞助作者 = 资助一个 AI 自主经营实验。

License

MIT