C:/Program Files/Git/insights overwrites previous reports with no versioning or backup
Resolved 💬 3 comments Opened Feb 27, 2026 by niomke Closed Mar 3, 2026
Problem
Running /insights generates a report to a fixed path (~/.claude/usage-data/report.html) that overwrites any previous report with no warning, no versioning, and no backup. Previous report data is permanently lost.
This is particularly problematic for users who want to track how their usage patterns, friction points, and interventions evolve over time — which is arguably the core value proposition of insights.
Current behavior
/insightswrites to~/.claude/usage-data/report.html(fixed path)- Running it again overwrites the file in-place
- No timestamped copies, no archive, no diff
- No hook event fires before
/insightsexecutes, so users can't reliably automate a backup
Expected behavior
Any of these would work:
- Timestamped filenames —
report-2026-02-27.html(simplest) - Auto-archive — copy previous report to
report-YYYY-MM-DD-HHMMSS.htmlbefore writing new one - Built-in diff/comparison — show what changed since last report (most valuable)
Workaround
A SessionStart hook that copies the report file on every session start:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "cp ~/.claude/usage-data/report.html ~/.claude/usage-data/report-$(date +%Y%m%d-%H%M%S).html 2>/dev/null || true"
}
]
}
]
}
}
This is imprecise (backs up per-session, not per-/insights run) but prevents silent data loss.
Additional context
/insightsis a built-in slash command that doesn't go through the hook lifecycle (PreToolUse, etc.), so there's no way to intercept it directly- The
UserPromptSubmithook could detect/insightsin prompt text but can't reliably execute a backup before the command handler runs - Users tracking their improvement over time (responding to friction analysis, adding guardrails, etc.) lose the ability to measure whether interventions worked
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗