/insights analyzes only ~6 days despite 30+ days of valid transcripts on disk (CLI 2.1.139, Windows 11)

Resolved 💬 3 comments Opened May 11, 2026 by mhunoval-certusgc Closed May 15, 2026

Summary

On CLI 2.1.139 (Windows 11 Pro, native install), /insights analyzes only the last ~6 days of sessions even though ~/.claude/projects/ contains ~30 days of valid transcripts. The report itself acknowledges the gap — its header reads 49 messages across 20 sessions (559 total) | 2026-05-05 to 2026-05-11 (20 ingested out of 559 known sessions). Deleting ~/.claude/usage-data/session-meta/ and re-running headless does not backfill from the older transcripts.

This appears to be the same class of regression as the closed/stale #22123 (which was macOS-specific and pre-2.1.27 era), so filing fresh.

Environment

  • OS: Windows 11 Pro 10.0.26300
  • Shell: PowerShell 7 (also tested via Git Bash)
  • CLI: 2.1.139 (reproduced on 2.1.138 first, upgraded mid-investigation, window did not change)
  • Install: native binary at ~/.local/bin/claude.exe

Reproduction

  1. ~/.claude/projects/ has 559 user session jsonls (top-level, excluding subagents/), dating back to 2026-04-14. Bucketed by file mtime:
  • 2026-04-14 → 2026-04-30: 189 sessions
  • 2026-05-01 → 2026-05-04: 162 sessions
  • 2026-05-05 → 2026-05-11: 250 sessions
  1. Sampled an Apr 24 transcript (474c8fb7-...jsonl): 69 lines, valid type: user/type: assistant records, ISO timestamps from 2026-04-24T14:33Z, real prompt content. Not stale or empty.
  1. Run /insights (no args). Report covers only 2026-05-05 → 2026-05-11, 20 sessions analyzed, 539 sessions ignored.

Cache deletion does not backfill

Remove-Item -Recurse -Force ~/.claude/usage-data/session-meta, ~/.claude/usage-data/facets
claude -p "/insights"

Result after regen:

  • session-meta/ repopulated with 200 files, all dated 2026-05-05 or later
  • report.html date range unchanged (2026-05-05 → 2026-05-11)
  • 359 user transcripts that exist in ~/.claude/projects/ and pre-date 2026-05-05 remain unindexed

So the cutoff is not driven by the cache — it survives cache deletion. It's a filter inside /insights itself.

What's not the cause

  • No firstSessionDate field in .claude.json, ~/.claude/settings.json, or ~/.claude/settings.local.json (full text search).
  • No cleanupPeriodDays / conversationRetentionDays setting in any of the above.
  • File ACLs on the older transcripts are identical to recent ones.
  • Pre-cutoff transcripts contain the same type, cwd, sessionId, timestamp, message.role fields as recent ones.

Workaround

Wrote a small Python analyzer that walks ~/.claude/projects/**/*.jsonl directly and produces a markdown summary. On the same data:

| | /insights | Direct walk |
|---|---:|---:|
| Sessions analyzed | 20 | 560 |
| Date range | 6 days | 30 days |
| User messages | ~49 (only counts ingested) | 12,161 |

The data is fully recoverable from disk — the gap is purely in the /insights filter.

Asks

  1. Is this the same root cause as #22123, or a separate filter?
  2. Document the effective default window. Community guidance (YouTube creators, docs) currently implies ~30 days, but the actual behavior on at least Windows 2.1.139 is ~6 days.
  3. Provide either:
  • A documented backfill command (e.g. claude insights --rebuild or similar), or
  • A --days N / --since YYYY-MM-DD argument on /insights, or
  • A documented config key (e.g. insightsWindowDays) so users can override the implicit window.

Happy to attach the analyzer script or sample data if useful.

View original on GitHub ↗

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