Caveman Stats

JuliusBrussee/caveman/skills/caveman-stats

作者 JuliusBrussee2e08b9177c07bb7249a8a2d1a6758e5db281d002无许可证110K 个星标收录于 2026年10月9日更新于 2026年10月9日仓库今天更新

Show recorded output and cache-read token usage and mode attribution for the current Claude Code session, or locate the host's native usage report. Trigger: /caveman-stats.

仅含说明Data & Analytics
AI 生成的概览

报告当前 Claude Code 会话中已记录的输出与缓存读取 token 用量及模式归属。

功能
该技能展示当前 Claude Code 会话中已记录的输出与缓存读取 token 用量、响应次数以及可用的模式归属,或指引用户查看宿主原生的用量报告。在 Claude Code 中由钩子提供报告,并在围栏代码块中逐字打印;在 Gemini CLI 中则引导用户使用 /stats model 或 /stats session。它还支持 --all 与 --since 7d 等聚合参数以及 --share 模式,并按实测字节大小报告原始/当前记忆文件对。它明确说明节省量未知,不会推断节省的 token、百分比、金额或净结果。
适用场景
当你需要查看当前 Claude Code 会话中已记录的 token 用量与模式归属,或需要找到宿主原生用量报告时使用。它也适用于跨会话聚合已记录的输出次数,或查看记忆文件大小差异。它不用于估算节省量,因为不存在实测对比。
运行要求
在 Claude Code 中运行,依赖钩子文件 src/hooks/caveman-mode-tracker.js 与 src/hooks/caveman-stats.js;在 Gemini CLI 中仅引导用户使用内置 /stats 命令。该技能不附带脚本,仅为说明性指令。Claude 读取器及其生命周期历史仅适用于 Claude Code。

In Claude Code, src/hooks/caveman-mode-tracker.js resolves src/hooks/caveman-stats.js next to itself and runs it on /caveman-stats. The hook does not block the prompt: it supplies the report through hookSpecificOutput.additionalContext with an instruction to print it verbatim inside a fenced code block. Do exactly that, and do not calculate, recompute or re-round the numbers yourself.

In Gemini CLI, direct the user to /stats model for current session token usage or /stats session for session statistics. Gemini custom commands are prompts; they cannot invoke the built-in command or read its live session metrics. Never read Claude Code transcripts as Gemini usage. In other hosts, use a native usage report if one is available; otherwise say that current session usage is unavailable. The Claude reader and its lifetime history apply only to Claude Code. Savings remain unknown in every host without a measured comparison.

The report shows recorded output and cache-read tokens, response counts, and mode attribution where available. Savings are unknown: the transcript has no measured comparison without Caveman. Do not infer saved tokens, percentages, dollars, rule overhead, or a net result from output counts or the current mode.

--all and --since 7d aggregate the latest recorded output count per session. --share reports observed usage with savings unknown. Historical est_saved_* fields are ignored; their original history rows remain on disk. The statusline shows the active mode without the retired savings badge.

Original/current memory-file pairs are reported by their measured byte sizes. Those file-size differences do not establish provider token or billing savings. See docs/HONEST-NUMBERS.md.

来源与署名

来源:JuliusBrussee/caveman位于skills/caveman-stats提交2e08b91

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架