/insights report headline stats miscount sessions and messages

Resolved 💬 5 comments Opened Feb 21, 2026 by RHH-CQER Closed Apr 13, 2026

Bug Description

The /insights command generates a report with headline stats that don't match the underlying data it collected.

Environment

  • Claude Code (latest as of 2026-02-21)
  • macOS 15 (Mac Studio, Apple Silicon)

What happens

Running /insights produces a report header:

207 messages across 25 sessions (35 total) | 2026-01-11 to 2026-02-21

What the actual data shows

Inspecting the files /insights itself generates:

| Metric | Report claims | Actual data in session-meta/ |
|--------|-------------|------------------------------|
| Sessions analyzed | 25 | 31 (facets/*.json count) |
| Sessions total | 35 | 35 (correct) |
| Messages | 207 | 175 user + 2,685 assistant = 2,860 total |

Evidence

# Facets (analyzed sessions) = 31, not 25
$ ls ~/.claude/usage-data/facets/*.json | wc -l
31

# Session-meta (total) = 35
$ ls ~/.claude/usage-data/session-meta/*.json | wc -l
35

# Actual message counts from session-meta
# user_message_count sum = 175
# assistant_message_count sum = 2,685
# Total = 2,860

Issues

  1. Analyzed session count is wrong: Report says "25 analyzed" but there are 31 facet files, meaning 31 sessions were actually analyzed.
  2. Message count is unclear and wrong: "207 messages" doesn't match either user messages (175) or total messages (2,860). It's not clear what it's counting.
  3. "Messages" is ambiguous: The headline should clarify whether it means user messages, assistant messages, or total conversation turns. For a power user running long autonomous sessions with many assistant turns and subagent delegations, counting only user messages dramatically understates actual usage.

Expected behavior

  • Analyzed session count should match the number of facet files generated
  • Message count should either match the sum of user_message_count across session-meta files, or (better) show total conversation messages
  • Consider showing both: e.g., "175 user messages / 2,860 total across 31 sessions (35 total)"

Reproduction

  1. Run /insights
  2. Compare the headline stats in report.html against the raw counts in session-meta/*.json and facets/*.json

View original on GitHub ↗

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