Index of every page on this site: llms.txt
All skills
juliusbrussee avatar

/caveman-stats

@bad48a0
by Julius Brusseejuliusbrussee/caveman114k stars
6,594
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/juliusbrussee/caveman/caveman-stats

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

README.md

≈689 tokens on demand. Your agent reads this file only when SKILL.md points to it.

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.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts15d3 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    The skill reports token usage by reading local session logs. A potential risk of indirect prompt injection exists because it processes untrusted conversation history and instructs the agent to output the data verbatim.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

Signed by skilld at bad48a0. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated last month

README badge

README badge for juliusbrussee/caveman/caveman-stats