claude-code - 💡(How to fix) Fix Stats dashboard streak broken despite valid session data on disk [3 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48213Fetched 2026-04-15 06:29:59
View on GitHub
Comments
3
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
commented ×3labeled ×3
RAW_BUFFERClick to expand / collapse

Bug

The stats dashboard shows a broken streak (reset to 1d from 29d) with a gap on April 13, 2026 — but valid session JSONL files exist on disk for that day.

Evidence

6 session files exist for April 13:

Session IDSizeLinesSubagents
48ebc8aa2.7 MB(binary parse)43 subagent files
02578da72.8 MB58314 subagent files
922a98e92.6 MB5103 subagent files
9228b2602.2 MB4956 subagent files
942ce2bf1.2 MB263
648250a7118 KB44

These are clearly real interactive sessions with substantial content and subagent work.

Suspicious detail: All 6 files have the exact same mtime2026-04-13 21:08:51/21:08:52 — within a 1-second window. This suggests they were bulk-written (sync, migration, or backup restore?) rather than naturally closed throughout the day. The stats heatmap may be keyed off file metadata that doesn't reflect the actual session activity timestamps.

Expected behavior

The streak counter and heatmap should count April 13 as an active day, since session data with real interactive content exists for that date.

Environment

  • Claude Code version: 2.1.87
  • macOS (Darwin 24.6.0)
  • Stats dashboard shows: 325 sessions, 137K messages, 42.7M tokens, 34 active days
  • Current streak: 1d (should be 30d+)
  • Longest streak: 29d

Screenshot

The heatmap shows a clear gap day (April 13) surrounded by heavy activity on April 12 and April 14, which reset the streak counter.

extent analysis

TL;DR

Update the stats dashboard to consider session content timestamps instead of relying solely on file metadata timestamps to accurately reflect active days.

Guidance

  • Investigate how the stats dashboard currently determines active days and streaks, focusing on whether it uses file modification times (mtime) or actual session activity timestamps.
  • Verify if the bulk-writing of session files (as suggested by the identical mtime values) is causing the discrepancy between the expected and actual behavior.
  • Consider updating the dashboard to use a more robust method for determining active days, such as parsing session start/end timestamps from the JSONL files.
  • Review the code responsible for updating the streak counter to ensure it correctly handles days with session activity, even if the sessions were bulk-written.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The solution may require changes to the stats dashboard's logic for determining active days and updating the streak counter. The identical mtime values for the session files on April 13 suggest that the issue might be related to how these files were written or updated.

Recommendation

Apply a workaround by updating the stats dashboard to use session content timestamps, as this approach is more likely to accurately reflect active days and maintain the correct streak counter.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The streak counter and heatmap should count April 13 as an active day, since session data with real interactive content exists for that date.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Stats dashboard streak broken despite valid session data on disk [3 comments, 1 participants]