claude-code - 💡(How to fix) Fix Stats heatmap counts a day active only if a session STARTED that day — days spent entirely in resumed sessions show 0 and break the streak

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…

Error Message

Error Messages/Logs

Root Cause

The usage stats screen (heatmap / current streak) appears to bucket activity by the session's START date rather than by each message's own timestamp. Repro: work for a full day entirely inside a long-running session that was started on an earlier day (resume across midnight, no new session that day). The day shows 0 activity in the heatmap even though the transcript contains real user/assistant messages timestamped that day, and the current-streak counter breaks at it. Concrete case: a day with 4 sessions / 428 message-lines (verified in ~/.claude/projects/**/*.jsonl, timestamps 06:49–17:25 UTC) rendered as "0" because zero sessions had their first message on that date — all activity lived in sessions started 5 days earlier. Expected: a day is "active" if any message timestamp falls on it, regardless of when the containing session started. Env: claude-code 2.1.165, macOS.

Code Example

A day in the usage stats should be counted as "active" if any message in
any transcript has a timestamp on that calendar day — regardless of when
the containing session was started.

Currently the heatmap / streak counter appears to bucket activity by the
session's START date, so a day spent entirely inside a long-running
session that was resumed from an earlier day shows 0 activity and breaks
the current-streak counter, even though that day's transcript contains
real user/assistant messages.

Expected: activity is attributed per-message-timestamp, not per-session-
start. Days worked entirely within resumed sessions should light up in
the heatmap and keep the streak intact.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The usage stats screen (heatmap / current streak) appears to bucket activity by the session's START date rather than by each message's own timestamp. Repro: work for a full day entirely inside a long-running session that was started on an earlier day (resume across midnight, no new session that day). The day shows 0 activity in the heatmap even though the transcript contains real user/assistant messages timestamped that day, and the current-streak counter breaks at it. Concrete case: a day with 4 sessions / 428 message-lines (verified in ~/.claude/projects/**/*.jsonl, timestamps 06:49–17:25 UTC) rendered as "0" because zero sessions had their first message on that date — all activity lived in sessions started 5 days earlier. Expected: a day is "active" if any message timestamp falls on it, regardless of when the containing session started. Env: claude-code 2.1.165, macOS.

What Should Happen?

A day in the usage stats should count as "active" if any message in any transcript has a timestamp on that calendar day — regardless of when the session that contains it was started.

Activity should be attributed per-message-timestamp, not per-session- start date. A day worked entirely inside a long-running session that was resumed from an earlier day should still light up in the heatmap and keep the current streak intact.

Error Messages/Logs

A day in the usage stats should be counted as "active" if any message in
any transcript has a timestamp on that calendar day — regardless of when
the containing session was started.

Currently the heatmap / streak counter appears to bucket activity by the
session's START date, so a day spent entirely inside a long-running
session that was resumed from an earlier day shows 0 activity and breaks
the current-streak counter, even though that day's transcript contains
real user/assistant messages.

Expected: activity is attributed per-message-timestamp, not per-session-
start. Days worked entirely within resumed sessions should light up in
the heatmap and keep the streak intact.

Steps to Reproduce

  1. Start a Claude Code session on day A (e.g. May 26) and do some work.
  2. Keep that same session running and resume it over the following days WITHOUT starting any new session — i.e. on day B (e.g. May 31) do all your work inside that already-open session, across the midnight boundary. (No new session has its first message on day B.)
  3. Confirm real activity exists on day B: the transcript files in ~/.claude/projects/**/*.jsonl contain user/assistant messages with timestamps on day B (in my case 4 sessions, 428 message-lines, 06:49–17:25 UTC).
  4. Open the usage stats / heatmap screen.

Result: day B shows 0 activity in the heatmap and the current-streak counter breaks at day B — even though day B has real messages. Every neighbouring day (which had at least one session START that day) is counted correctly. The only distinguishing factor of day B is that zero sessions had their FIRST message on it.

Env: claude-code 2.1.165, macOS.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

claude-code 2.1.165

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING