/stats shows 0 activity for days where work happened inside a long-running session
Environment
- Claude Code:
2.1.139 - Node:
v24.6.0 - macOS:
26.2(build25C56) - Shell: zsh
Summary
Daily activity in /stats appears to be bucketed by the session file's last-modified date (or by a single per-session date) rather than by the per-message timestamps inside the .jsonl. When a single session spans multiple days, every day except one shows 0 messages, 0 sessions, 0 tool calls, even though hundreds of messages were exchanged on those days.
Repro
- Start a Claude Code session on day N.
- Keep resuming/continuing the same session across days N+1, N+2, N+3.
- Open
/stats. - Expected: each day N..N+3 shows the activity that actually happened that day.
- Actual: only one day (the day with the session file's mtime) shows activity; the other days show 0 — even though
grep '"timestamp":"<date>"' <session>.jsonlreturns hundreds of entries per missing day.
Concrete evidence
- One session file's mtime is
2026-05-23 09:20, but the in-filetimestampfields span four distinct dates (2026-05-19through2026-05-22). - Count of messages timestamped
2026-05-21: 375. /statsshows 0 interactions for 2026-05-21 (a Thursday I actively worked).- Across all
~/.claude/projects/*/*.jsonl, no file has an mtime on2026-05-21— they jump from May 19 → May 22 → May 23, even though message timestamps inside those files cover May 20 and May 21.
Likely fix
When building dailyActivity in ~/.claude/stats-cache.json, group messages by their own timestamp field (YYYY-MM-DD in the user's local timezone, ideally configurable) rather than by file mtime or a single per-session date.
Side note
My ~/.claude/stats-cache.json has lastComputedDate: 2026-02-17 — it hasn't updated in 3 months. May be the same bug or a separate cache-refresh issue, flagging in case it's related.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗