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

  • /insights writes 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 /insights executes, so users can't reliably automate a backup

Expected behavior

Any of these would work:

  1. Timestamped filenamesreport-2026-02-27.html (simplest)
  2. Auto-archive — copy previous report to report-YYYY-MM-DD-HHMMSS.html before writing new one
  3. 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

  • /insights is 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 UserPromptSubmit hook could detect /insights in 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

View original on GitHub ↗

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