[BUG] /insights report: table-of-contents anchors (#section-*) don't match any element id; narrative sections can render empty

Status Closed — duplicate
Maintainer reply None cached
Activity 4 comments · opened Jul 28, 2026 · closed Aug 15, 2026

Summary

The /insights slash command generates a local static HTML report (~/.claude/usage-data/report-<timestamp>.html). Two related but distinct bugs were found in this report:

  1. Broken table-of-contents anchors. The report's <nav class="nav-toc"> links to 8 anchors, in document order:
  • #section-work
  • #section-usage
  • #section-wins
  • #section-friction
  • #section-features
  • #section-patterns
  • #section-horizon
  • #section-feedback

None of these id attributes exist anywhere in the generated HTML. Running grep -o 'id="section-[a-z]*"' against the report returns zero matches, while the corresponding href values in the nav all match as expected. Clicking any TOC link (e.g. "Team Feedback") does nothing, because no element in the page has id="section-feedback" (or any id="section-*").

  1. Narrative sections can render entirely empty. Separately, in the reporter's case the at-a-glance narrative said "_No insights generated_" — the LLM-driven narrative-synthesis step produced no content for this session's data across all 8 narrative "slots" (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).

Since the anchors were missing regardless of whether narrative content rendered, this suggests the template's section wrapper elements never emit the id="section-*" attribute in the first place — independent of whether narrative synthesis succeeds or fails for a given session.

Repro Steps

  1. Run /insights in Claude Code.
  2. Open the generated report HTML file (~/.claude/usage-data/report-<timestamp>.html).
  3. Click any TOC link in the nav (e.g. "Team Feedback").
  4. Observe: nothing happens — the page does not scroll/jump, because no element has a matching id="section-feedback" (or any id="section-*").
  5. (Separately observed in this run) The at-a-glance narrative area shows "No insights generated" for all sections, indicating the narrative-synthesis step produced no content for this session.

Environment

  • Claude Code CLI
  • Command: /insights
  • Artifact: generated static HTML report file (no server involved)

Suggested Fix

  • Emit id="section-work", id="section-usage", id="section-wins", id="section-friction", id="section-features", id="section-patterns", id="section-horizon", id="section-feedback" on the actual section wrapper elements in the report template, so the existing TOC nav hrefs resolve correctly regardless of whether narrative content is populated.
  • Separately investigate why the narrative-synthesis step produced no content ("No insights generated") for this session — this may be a distinct issue from the missing anchor ids.

Notes

No report file, session content, message counts, or file paths from the reporter's actual usage data are attached — this report is generic/anonymized per the description above.

View original on GitHub ↗

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