claude-code - 💡(How to fix) Fix Stats cache not updating since March 2, 2026 - 283+ sessions not tracked [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#46139Fetched 2026-04-11 06:28:03
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

The ~/.claude/stats-cache.json file has not been updated since March 2, 2026, despite 283+ active sessions being created since then. All session data is being properly saved to .jsonl files, but the aggregated statistics are not being computed.

Root Cause

The ~/.claude/stats-cache.json file has not been updated since March 2, 2026, despite 283+ active sessions being created since then. All session data is being properly saved to .jsonl files, but the aggregated statistics are not being computed.

Code Example

$ stat ~/.claude/stats-cache.json
Last modified: Mar  2 16:43:24 2026

$ find ~/.claude/projects -name "*.jsonl" -type f -newermt "2026-03-02" | wc -l
283
RAW_BUFFERClick to expand / collapse

Description

The ~/.claude/stats-cache.json file has not been updated since March 2, 2026, despite 283+ active sessions being created since then. All session data is being properly saved to .jsonl files, but the aggregated statistics are not being computed.

Environment

  • Claude Code Version: 2.0.64
  • OS: macOS (Darwin 25.3.0, ARM64)
  • Date Reported: April 10, 2026

Steps to Reproduce

  1. Check last update date in ~/.claude/stats-cache.json
  2. Compare with recent session files in ~/.claude/projects/
  3. Observe gap of over 1 month with no stats updates

Expected Behavior

The stats cache should be continuously updated with:

  • Daily activity counts (messages, sessions, tool calls)
  • Token usage per model
  • Cost calculations
  • Session statistics

Actual Behavior

  • Last computed date in stats file: "lastComputedDate": "2026-03-01"
  • File modification time: March 2, 2026 at 16:43:24
  • 283+ session files created since March 2 are not reflected in stats
  • All individual session .jsonl files are being saved correctly

Additional Context

All session transcripts are being properly written to ~/.claude/projects/, so the issue appears to be specifically with the stats aggregation process. No visible errors are shown during normal Claude Code usage.

Evidence

$ stat ~/.claude/stats-cache.json
Last modified: Mar  2 16:43:24 2026

$ find ~/.claude/projects -name "*.jsonl" -type f -newermt "2026-03-02" | wc -l
283

extent analysis

TL;DR

The issue can likely be resolved by investigating and potentially restarting the stats aggregation process that updates the ~/.claude/stats-cache.json file.

Guidance

  • Verify if there's a scheduled task or a background process responsible for updating the stats-cache.json file and check its status.
  • Investigate the logs or system messages for any errors related to the stats aggregation process that might have caused it to fail or not run since March 2, 2026.
  • Check the configuration files or settings of Claude Code version 2.0.64 to see if there are any options related to the frequency or triggering of stats updates.
  • Consider manually triggering the stats update process if such an option is available, to see if it updates the stats-cache.json file correctly.

Example

No specific code snippet can be provided without knowing the exact implementation details of the stats aggregation process in Claude Code.

Notes

The solution might depend on the internal workings of Claude Code version 2.0.64, specifically how it handles stats aggregation and updates the stats-cache.json file. Without access to the source code or documentation of this version, the guidance is limited to general troubleshooting steps.

Recommendation

Apply workaround: Manually investigate and potentially trigger the stats aggregation process to update the stats-cache.json file, as the root cause of the issue is not immediately clear and may require deeper investigation into the Claude Code's internal processes.

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