C

caveman-stats

by @juliusbrusseev
4.9(120)

This skill provides immediate access to formatted statistics, allowing users to instantly view their AI usage. It requires no additional model processing, directly presenting key figures to help users quickly understand and analyze AI interaction patterns.

statstrackinganalysisusagereportingGitHub
Installation
npx skills add https://github.com/juliusbrussee/caveman --skill caveman-stats
compare_arrows

Before / After Comparison

1 组
Before

Without an instant statistics tool, users might need to manually collect or wait for reports to understand AI usage. This is time-consuming and makes it difficult to grasp real-time AI interaction patterns and efficiency, leading to delayed decisions or inability to optimize AI strategies promptly.

After

With the `caveman-stats` skill, users can immediately access formatted AI usage statistics. No waiting is required; key figures are presented directly, helping users quickly gain insights into AI performance, adjust strategies promptly, and enhance AI interaction experience and efficiency.

SKILL.md

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.


caveman-stats

Recorded session usage. Savings stay unknown without a measured comparison.

What it does

Reads the current Claude Code session log and reports output tokens, cache-read input tokens, and response counts. When a mode-transition log is available, it separates output by the mode active for each response. Missing mode attribution stays unknown. Numbers come from the JSONL session log on disk — the model itself does not compute or estimate them. Output is injected by the caveman-mode-tracker hook, which intercepts /caveman-stats, runs the stats script, and hands the formatted block back as additionalContext with an instruction to print it verbatim.

The transcript does not contain the same session without Caveman, so the report cannot calculate tokens saved, a reduction percentage, dollars saved, rule overhead, or a net result. Earlier releases applied a fixed ratio without a committed reviewed benchmark. Those estimates no longer appear in session reports, lifetime totals, shared summaries, or the statusline.

In Claude Code, every session also writes a snapshot when it ends (a SessionEnd hook runs the same script with --record, silently), so --all and --since count every session, not only the ones where you ran /caveman-stats.

Recorded history stays on disk. New snapshots contain observed usage and mode attribution; historical estimated-savings fields are ignored. Original/current memory-file pairs show byte-size differences separately, without treating them as provider savings.

How to invoke

/caveman-stats
/caveman-stats --all
/caveman-stats --since 7d
/caveman-stats --share

Claude Code's hook runs src/hooks/caveman-stats.js and tells the model to relay the generated report verbatim. The model does not estimate the numbers.

Example output

An illustrative transcript with one response and 1,000 output tokens produces:

Turns:    1
──────────────────────────────────
Output tokens:         1,000
Cache-read tokens:     2,400
──────────────────────────────────
Mode: full (current mode; no transition log)
Savings: unknown — no measured comparison for this session.

See also

Gemini CLI uses its native /stats model or /stats session report. The Caveman command points there; it cannot access Gemini's live metrics or aggregate Claude transcripts as Gemini usage. Gemini command reference.

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs383.1K
Rating4.9 / 5.0
Version
Updated2026年11月18日
Comparisons1

User Rating

4.9(120)
5
37%
4
43%
3
13%
2
5%
1
2%

Rate this Skill

0.0

Compatible Platforms

🤖claude-code

Timeline

Created2026年5月8日
Last Updated2026年11月18日
🎁 Agent Knowledge Cards
Survey