Stats cache lastComputedDate not advancing; new model IDs missing from modelUsage rollup
Environment
- Claude Code:
2.1.139 - Node:
v24.6.0 - macOS:
26.2(build25C56) - Auth:
claude.ai(subscription)
Summary
~/.claude/stats-cache.json stopped advancing on 2026-02-17. Three months of subsequent activity is absent from the cache, even though heavy usage continued every day. As a side effect, models released since Feb 2026 (e.g. claude-opus-4-7, claude-haiku-4-5-20251001) are completely missing from the modelUsage rollup, even though raw .jsonl session files clearly record them.
This may be related to / the root cause of #61683 (multi-day session bucketing): if recompute fails on long-running multi-day sessions, lastComputedDate never gets written forward.
Evidence from my install
{
"version": 2,
"lastComputedDate": "2026-02-17",
"totalSessions": 34,
"totalMessages": 22142,
"modelUsage": {
"claude-opus-4-5-20251101": { ... },
"claude-sonnet-4-5-20250929": { ... },
"claude-opus-4-6": { ... }
}
}
Meanwhile, scanning ~/.claude/projects/**/*.jsonl directly:
| Month | Distinct sessions touched | Total messages observed |
|---|---:|---:|
| 2026-05 (so far) | 200+ | ~30,000+ |
| Models seen | claude-opus-4-7, claude-haiku-4-5-20251001 (also <synthetic>) | — |
None of this post-Feb-17 activity is in the cache, and the new model IDs never appear in modelUsage.
Repro
- Use Claude Code regularly across at least one model upgrade (Feb 2026 was the cutoff in my case).
- Inspect
~/.claude/stats-cache.json—lastComputedDatestays stuck at the last good date, andmodelUsagekeys never gain the new model IDs. /statsshows progressively staler / less complete daily counts.
Suggested investigation
- Check the recompute path for an early-return / unhandled-error when encountering session files whose first-message date predates
lastComputedDatebut whose last-message date is after it (i.e. multi-day sessions, see #61683). - Ensure unknown / new model IDs in session
usageblocks are added tomodelUsagerather than silently skipped. - Consider a hard cap: if
lastComputedDateis more than N days behind today, force a full rebuild rather than incremental.
Side effect of this bug
Subscription users (claude.ai auth) lose visibility into their actual model usage breakdown since the cache freeze. Even though costUSD is intentionally 0 for subscription accounts, the token counts per model are still the only insight users have into "what model am I actually running through" — and that signal is silently broken.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗