[Bug] /insights narratives not rendering - all sections missing since v2.1.220

Status Closed — duplicate
Reported on v2.1.220
Maintainer reply None cached
Activity 1 comment · opened Jul 25, 2026 · closed Aug 15, 2026

[BUG] /insights renders stats but all narrative sections are missing — "No insights generated", failures swallowed silently

Environment

  • Claude Code version: 2.1.220 (auto-upgraded from 2.1.219 hours before the affected runs)
  • Platform: Linux (Debian 13, kernel 6.12)
  • Session model: claude-fable-5[1m]
  • Notable settings: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, effortLevel: high, managed/enterprise environment (policy-limits.json present)

Summary

/insights generates the report HTML with all quantitative content (session counts, charts, tool-error breakdowns), but every LLM-generated narrative section is missing: 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. The insights JSON handed back to the session is literally {} and the report renders the fallback _No insights generated_.

These sections rendered correctly until 2026-07-20. Every run since (three runs on 2026-07-25) produces the empty-narrative report.

What I ruled out with local diagnostics

  • Non-LLM phase is healthy. ~/.claude/usage-data/session-meta/ updates normally on every run (445 files, refreshed at run time). Report header correctly shows "347 sessions total · 262 analyzed".
  • Facet extraction produces nothing. ~/.claude/usage-data/facets/ has 100 files and zero new files since 2026-07-20, despite many new eligible sessions since then. So the per-session facet LLM step yields no persisted output.
  • --debug shows no errors at all during an /insights run.
  • Not model access or auth. The insights pipeline resolves its model via the Opus default (ANTHROPIC_DEFAULT_OPUS_MODEL → opus5). A manual headless call with that model works from the same machine and returns clean JSON:

``
$ claude --model claude-opus-5 -p 'Reply with only this exact JSON and nothing else: {"ok":true}'
{"ok":true}
``

  • Not experimental agent teams. Enabled 2026-07-20 (coincides with the breakage date), but the pipeline explicitly supports concurrent sessions (detectMultiClauding overlap stats), and team sessions still produce session-meta fine.
  • Not a timezone change. Also happened around 2026-07-20, but the cache/freshness logic compares epoch-millisecond mtimes and UTC ISO timestamps — nothing timezone-sensitive.

Why the failure is invisible (from reading the bundled pipeline code)

The facet extractor has silent null paths that log nothing, even in debug mode:

  1. If the model response contains no {...} to extract (match(/\{[\s\S]*\}/) fails) → return null, no log.
  2. If the extracted JSON fails the facet schema validation → return null, no log.
  3. Only a thrown API error is logged (Facet extraction failed: ...), and only at debug level.

The narrative synthesis step aggregates per-section results with if (result) sections[name] = result, so when every section call yields nothing, the user gets insights: {} with no error surfaced anywhere.

Given that API calls demonstrably work and --debug prints nothing, the likely failure mode is responses coming back in a shape the parser rejects (path 1 or 2 above), swallowed silently for every session and every section.

Steps to reproduce (on this machine)

  1. Run /insights in any session.
  2. Report HTML is written with charts but _No insights generated_ in place of all narrative sections; insights JSON is {}.
  3. usage-data/facets/ gains no new files; usage-data/session-meta/ updates normally.

Expected behavior

  • Narrative sections generated as before 2026-07-20; or
  • A user-visible error explaining that facet extraction / section synthesis failed and why.

Requests

  1. Surface failures: if facet extraction or section synthesis fails, tell the user instead of rendering an empty report that looks like "you have no insights".
  2. Log the rejection reason (no-JSON-match vs schema-validation-fail vs API error) outside debug mode, e.g. into the report or a log file under usage-data/, so users can attach it to bug reports.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗