/stats shows 0 activity for days where work happened inside a long-running session

Resolved 💬 2 comments Opened May 23, 2026 by Emin-Emini Closed Jun 23, 2026

Environment

  • Claude Code: 2.1.139
  • Node: v24.6.0
  • macOS: 26.2 (build 25C56)
  • 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

  1. Start a Claude Code session on day N.
  2. Keep resuming/continuing the same session across days N+1, N+2, N+3.
  3. Open /stats.
  4. Expected: each day N..N+3 shows the activity that actually happened that day.
  5. 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>.jsonl returns hundreds of entries per missing day.

Concrete evidence

  • One session file's mtime is 2026-05-23 09:20, but the in-file timestamp fields span four distinct dates (2026-05-19 through 2026-05-22).
  • Count of messages timestamped 2026-05-21: 375.
  • /stats shows 0 interactions for 2026-05-21 (a Thursday I actively worked).
  • Across all ~/.claude/projects/*/*.jsonl, no file has an mtime on 2026-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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗