caveman-stats

Reports actual session token usage and estimated savings read from the Claude Code session log.

1|Updated May 3, 2021
One-click install
npx skills add https://github.com/leogurja/dotfiles --skill caveman-stats-leogurja
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: caveman-stats
Source: https://github.com/leogurja/dotfiles/tree/main/home/dot_agents/skills/caveman-stats
Command: npx skills add https://github.com/leogurja/dotfiles --skill caveman-stats-leogurja

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It removes guesswork from measuring token consumption by reading real input/output token counts directly from the session JSONL log instead of relying on model self-estimates, and it exposes when rule-injection overhead makes a terse-output workflow net-negative. ## Core Features & Use Cases - Real token accounting: Reads the current Claude Code session log on disk and reports actual input and output token counts per session. - Savings and net estimation: Compares output against an estimated non-caveman baseline, then subtracts per-turn rule overhead (default 1,250 tokens/turn, configurable via CAVEMAN_RULE_OVERHEAD_TOKENS) to show an honest net figure. - Statusline badge support: Writes a lifetime-savings suffix file consumed by a statusline badge showing cumulative gross savings. - Use Case: After a long coding session, run /caveman-stats to see whether the injected brevity rules actually saved tokens for that workload or cost more in input overhead than they returned in output savings. ## Quick Start Type /caveman-stats in the current session to display real token usage, estimated savings, rule overhead, and net result.

Frequently Asked Questions about caveman-stats

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check token usage for the current Claude Code session?▼

Run /caveman-stats in the active session. The caveman-mode-tracker hook intercepts the command, reads the session JSONL log on disk, and returns formatted input/output token counts plus estimated savings as the response.

How are the token savings numbers calculated?▼

Input and output counts come directly from the session log, while savings compare actual output against an estimated non-caveman baseline. The model itself never computes or estimates the numbers.

What does the Est. net line mean in the stats output?▼

Est. net subtracts the per-turn rule overhead (default 1,250 input tokens per turn) from the gross savings. When negative, the injected rules cost more input tokens than the output savings recovered, and the output says so directly.

Can I change the rule overhead estimate used in the calculation?▼

Yes, set the CAVEMAN_RULE_OVERHEAD_TOKENS environment variable to your own measured per-turn input cost. The default of 1,250 tokens per turn is only a benchmarked estimate.

Why does the statusline badge show a different number than /caveman-stats?▼

The badge intentionally shows lifetime gross savings as a glanceable summary, written to a suffix file each run. The /caveman-stats command shows the full net picture including rule overhead.