/insights: narrative sections silently empty ("No insights generated") despite valid facet data - regression + dead nav links
Summary
/insights generates a report whose narrative/LLM-generated sections are silently empty — the report shows "No insights generated" and the analysis payload is {} — even though the underlying per-session facet data is present and valid. The deterministic charts (built from the same facet data) render correctly, so this is isolated to the narrative-synthesis path. A report generated ~6 weeks earlier by the same feature rendered all narrative sections correctly, so this appears to be a regression.
There are effectively two bugs:
- Narrative synthesis returns empty despite valid facet input (the substantive issue).
- The HTML template emits the full navigation TOC unconditionally, even for sections that were not generated — producing dead anchor links (e.g. "Features to Try" scrolls nowhere because no matching
id="section-*"element exists).
Environment
- Claude Code CLI: v2.1.220
- OS: Windows 11
Expected behavior
The report's narrative sections (What You Work On, How You Use CC, Impressive Things, Where Things Go Wrong, Features to Try, New Usage Patterns, On the Horizon, Team Feedback) are populated from the analyzed session facets, and every nav link points to a rendered section.
Actual behavior
- All narrative sections are absent; report shows
_No insights generated_and the insights payload is{}. - Only the quantitative charts render.
- The nav TOC still lists all 8 links, but 6 of them target
id="section-*"anchors that do not exist in the document — clicking them does nothing.
Evidence
Comparing a previously-working report against today's (same feature, same machine):
| | Working report (earlier) | Broken reports (today, x2) |
|---|---|---|
| File size | 62.8 KB | 31.8 KB |
| id="section-*" anchors present | ✅ all 8 (section-work, section-features, section-wins, section-friction, section-patterns, section-horizon, section-usage) | ❌ 0 |
| Narrative content blocks (.narrative, .features-section, .big-wins, .horizon-section, .patterns-section, .friction-categories) | ✅ present | ❌ absent |
| Charts | ✅ | ✅ |
| Insights payload | populated | {} |
The input data is valid. The .claude/usage-data/facets/*.json directory contains 58 well-formed per-session files, each with fully-populated fields (e.g. underlying_goal, goal_categories, outcome, user_satisfaction_counts, claude_helpfulness, session_type, friction_counts, friction_detail, primary_success, brief_summary, session_id). These same files drive the charts, which render correctly — so the empty narrative is not caused by missing or malformed input.
Steps to reproduce
- Run
/insightson an account with a substantial session history. - Open the generated
report-*.html. - Observe the narrative sections are empty and the top-nav links (e.g. "Features to Try") are dead.
- Repeated runs reproduce identically (observed twice in a row).
Impact
- The most valuable part of
/insights(the qualitative write-up) is missing. - The report looks broken to the user because of the dead nav links, even though the charts are fine.
Suggested fixes
- Investigate why narrative synthesis returns
{}while facet data is valid (likely a regression in the synthesis/render path between the working version and v2.1.220). - Independently, make the nav TOC render conditionally — only emit links for sections that were actually generated — so a partial report never contains dead anchors.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗