/stats command excludes cache tokens from total, drastically underreporting usage
Resolved 💬 3 comments Opened Feb 2, 2026 by sergeykalenyuk Closed Feb 6, 2026
Summary
The /stats command shows total tokens that exclude cache read/creation tokens, leading to drastically underreported token usage.
Observed Behavior
/stats showed:
- Total tokens: 673.7k
But examining ~/.claude/stats-cache.json reveals the actual data:
"modelUsage": {
"claude-sonnet-4-5-20250929": {
"inputTokens": 85086,
"outputTokens": 481488,
"cacheReadInputTokens": 447915508,
"cacheCreationInputTokens": 35898840
},
"claude-opus-4-5-20251101": {
"inputTokens": 98969,
"outputTokens": 4443,
"cacheReadInputTokens": 145674505,
"cacheCreationInputTokens": 12237021
}
}
Actual Usage
- Direct input/output tokens: ~670k (what
/statsshows) - Cache read tokens: ~594M
- Cache creation tokens: ~48M
- Actual total: ~641 MILLION tokens
Expected Behavior
/stats should either:
- Include cache tokens in the total count
- Display cache tokens separately with clear labeling
- At minimum, indicate that the displayed total excludes cache operations
Impact
Users relying on /stats for usage tracking are seeing numbers ~1000x lower than actual usage. This is particularly misleading when:
- Planning API budget/costs
- Understanding why auto-compact triggered (4+ times in this case, which wouldn't make sense with only 673k total tokens)
- Debugging performance issues
Environment
- macOS (Darwin 24.6.0)
- Claude Code CLI
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗