Bug: /insights narrative analysis fails silently on large...

Open 💬 0 comments Opened Jul 4, 2026 by kupietools

Bug Description
Bug: /insights narrative analysis fails silently on large sessions, contradicting its own metadata

Summary: /insights produced a report with "0 sessions analyzed" / "Insufficient Data" for a session that was actually long and substantive. The structured metadata extraction worked correctly, but the narrative/goal summarization ("facet") step failed and fell back to an empty template — with no indication in the report that anything had failed.

Session ID: 932bbda2-1338-4506-9b6c-17b08a190829
Project: /home/kupietzc/public_html/kartscode

Evidence of the contradiction (both files under ~/.claude/usage-data/):

session-meta/932bbda2....json — correctly captured: 307 minutes duration, 46 user messages, 294 assistant messages, 771,086 output tokens, 26,320 input tokens, 13 files modified (280 lines added / 42 removed), tool usage (Read 21, Edit 18, Bash 48, Write 14, Agent 1), 1 subagent used.

facets/932bbda2....json — came back nearly empty, with:

"underlying_goal": "Unclear from the transcript, which only contains session metadata and API errors indicating Claude's responses exceeded the output token maximum"
"friction_detail": "Session content was not captured; only API token-limit errors are visible in the transcript"
"outcome": "unclear_from_transcript", "primary_success": "none"
Expected: A session this large should either (a) be analyzed correctly, or (b) if it exceeds some processing limit, the report should say so explicitly (e.g., "this session was too large to analyze") rather than presenting generic "Insufficient Data" / "warmup_minimal" language that reads as if no real work happened.

Suspected cause: The facet-generation step appears to call a model to summarize the transcript, and likely hit an output/context token limit given this session's unusual size (771K output tokens across 294 turns over 5+ hours). The structured session-meta extraction (presumably non-LLM, parsed directly from the transcript) was unaffected.

Impact: Misleading reports for exactly the long, high-effort sessions where usage insights would be most valuable — the failure mode makes it look like the session had no content, rather than surfacing a processing limitation.

Environment Info

  • Platform: linux
  • Terminal: vscode
  • Version: 2.0.1
  • Feedback ID: 103f4dfb-d043-4927-846e-bdbdf07a713b

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits.\"},\"request_id\":\"req_011CcgSkkkk538oVyMRUdmVZ\"}\n    at B4.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:895:20956)\n    at yP.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1034:2131)\n    at yP.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1034:5344)\n    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)","timestamp":"2026-07-04T05:12:57.129Z"},{"error":"Error: 1: 1 \n    at d44 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1020:4089)\n    at async u44 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1020:1655)","timestamp":"2026-07-04T05:23:13.507Z"},{"error":"fv1: Insufficient permissions for global npm install.\n    at qq0 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2194:1029)\n    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n    at async lY1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2204:43)\n    at async file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:3177:8694","timestamp":"2026-07-04T05:23:55.225Z"},{"error":"fv1: Insufficient permissions for global npm install.\n    at qq0 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2194:1029)\n    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n    at async lY1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2204:43)\n    at async Object.current (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:3177:8694)","timestamp":"2026-07-04T05:53:52.373Z"},{"error":"fv1: Insufficient permissions for global npm install.\n    at qq0 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2194:1029)\n    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n    at async lY1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2204:43)\n    at async Object.current (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:3177:8694)","timestamp":"2026-07-04T06:23:52.930Z"},{"error":"Error: 404 {\"type\":\"error\",\"error\":{\"type\":\"not_found_error\",\"message\":\"model: claude-3-5-haiku-20241022\"},\"request_id\":\"req_011CcgZDqooZiM3Hv2b72p8L\"}\n    at B4.generate (file:

Note: Error logs were truncated.

View original on GitHub ↗