跳到正文
Skillpedia
其他81k · #1603

cost-ledger

它能做什么

这项技能读取 AI 编程工具已在你电脑上保存的使用日志,按服务商展示开支、令牌和缓存使用情况。适合同时使用多个 AI 工具、希望统一查看的人。

适用场景

  • ✓当你询问本周在 AI 工具上花了多少钱时。
  • ✓当你想比较 Codex 和 Claude Code 的成本时。
  • ✓当你想查看哪些模型还没有价格时。

技能链接

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-ledger/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-ledger/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“本周我在所有服务商的 AI 编程工具上一共花了多少钱?”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能读取本地日志,按带日期的价格表为用量定价,并显示总计。没有价格的模型会单独列出,而不会被当作免费计算。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Cost Ledger

Reads the logs the agents already wrote (~/.claude/projects, $CODEX_HOME or ~/.codex) and prices them from data/prices.json (dated, editable).

Run

node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --since 7d
node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --provider codex --format json

One mission, or one project

--from and --to (ISO times) cut the window and --project <absolute path> keeps one project's rows; the console's mission page uses them for a mission's spend. An explicit --from/--to replaces the default 7-day look-back.

Read the result correctly

  • USD and Codex credits are never added. GPT-6 Codex models are priced in credits; their cached-input rate is unpublished, so the figure is an upper bound.
  • Estimates at list price, not bills. Subscriptions bill by window, not by token. /usage is authoritative for the live Claude session; the Console or provider dashboard is authoritative for invoices.
  • Unpriced models are listed, never counted as $0. Say so, and offer to add them to data/prices.json.
  • Counting rules (why numbers differ from naive sums): Claude messages are de-duplicated by message.id + requestId; Codex uses deltas of the running total_token_usage (never also last_token_usage), cached input is a subset of input, and forked rollouts are de-duplicated.
  • Claude transcript output tokens can under-count streamed output.

If the log directory is missing, say so; do not invent numbers.

常见问题

我的数据会被发送到别处吗?

这项技能只使用本地日志,不会发送任何内容。费用是按标价估算的,并非实际账单。

为什么美元和积分的总数对不上?

Codex 积分与美元永远不会相加,因为它们是不同的单位。

我能只查看某一个项目吗?

可以。项目设置可以把统计限制在某个项目文件夹内,也可以设置时间范围。

详情

作者的原始描述

One cost view across Claude Code, Codex and Grok on this machine — spend, tokens, cache hit ratio per provider and model, with unpriced models flagged. Use when asked "what did I spend", "how much did Codex cost", or to compare providers. Local logs only, nothing is sent.

repo: ruvnet/ruflo

热度

GitHub 星标
81k
排名
#1603
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能