claude-code - 💡(How to fix) Fix Add --days / --since flag to /insights to scope analysis window [1 comments, 2 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#46920Fetched 2026-04-12 13:29:40
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

The /insights command currently analyzes a fixed ~30-day window of session data. There is no way to scope it to a shorter period (e.g. the past 7 days), making it less useful for users who run it frequently — the report surfaces the same patterns week after week rather than fresh observations.

Root Cause

The /insights command currently analyzes a fixed ~30-day window of session data. There is no way to scope it to a shorter period (e.g. the past 7 days), making it less useful for users who run it frequently — the report surfaces the same patterns week after week rather than fresh observations.

Code Example

/insights --days 7
/insights --since 2026-04-05
RAW_BUFFERClick to expand / collapse

Feature Request

Summary

The /insights command currently analyzes a fixed ~30-day window of session data. There is no way to scope it to a shorter period (e.g. the past 7 days), making it less useful for users who run it frequently — the report surfaces the same patterns week after week rather than fresh observations.

Proposed API

/insights --days 7
/insights --since 2026-04-05

Both flags would filter the session data used for analysis to the specified window before generating the report. The HTML output filename could reflect the window (e.g. report-7d.html).

Motivation

I run /insights weekly and archive reports to a personal knowledge base. After the first few runs, the 30-day rolling window means each new report is ~80% overlap with the previous one — the same friction patterns, the same suggestions, the same interaction style summary. A --days 7 option would make each weekly report genuinely incremental.

Alternatives Considered

  • Manually moving session files out of ~/.claude/usage-data/ before running — works but is fragile and not user-friendly
  • Running insights less frequently — defeats the purpose of weekly reflection

Environment

  • Claude Code version: latest
  • OS: Arch Linux

extent analysis

TL;DR

Implementing a --days or --since flag for the /insights command would allow users to scope the analysis to a shorter period.

Guidance

  • Consider adding a command-line flag to filter session data based on a specified time window, such as --days or --since, to improve the usefulness of the /insights command for frequent users.
  • Evaluate the proposed API syntax, e.g., /insights --days 7 or /insights --since 2026-04-05, for clarity and usability.
  • Reflect the specified window in the HTML output filename, such as report-7d.html, to help users track and archive reports.
  • Assess the feasibility of integrating this feature into the existing /insights command without disrupting its current functionality.

Example

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

Notes

The implementation of this feature may require modifications to the session data processing and filtering logic within the /insights command.

Recommendation

Apply a workaround by manually adjusting the session data files or frequency of running the command until the proposed feature is implemented, as upgrading to a fixed version is not applicable in this case.

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