/insights facet extraction silently fails — AI analysis sections empty despite gateway working for interactive sessions

Resolved 💬 2 comments Opened Jun 23, 2026 by hardikkaushik-pronto Closed Jun 26, 2026

Summary

The /insights command generates a report but the AI-powered analysis sections (What You Wanted, Session Types, Outcomes, What Helped Most, At-a-glance) are all empty. The ~/.claude/usage-data/facets/ directory is never created.

Environment

  • Claude Code version: 2.1.186
  • Platform: macOS (darwin 25.2.0, arm64)
  • Auth method: OAuth (claude.ai login)
  • Gateway: corporate gateway at bifrost.pronto.prod (configured via gateway-models.json)

Steps to reproduce

  1. Run /insights in any session
  2. Open the generated HTML report
  3. Observe that all AI-generated sections show "No data" or are blank

Expected behavior

~/.claude/usage-data/facets/ is created and populated with per-session facet JSON files. AI analysis sections in the report are filled in.

Actual behavior

~/.claude/usage-data/facets/ is never created. The insights command receives {} as insights data. All AI narrative sections are empty.

Investigation

From inspecting the binary, facet extraction:

  • Makes LLM calls with isNonInteractiveSession: true and querySource: "insights"
  • Logs "Facet extraction failed: <error>" on failure but this is silent in normal usage
  • Uses a separate model selector (Y$l()) from the interactive session model

Key finding: Teammates on the same corporate gateway have working /insights with facets populated. This rules out a gateway-wide block. The issue appears specific to this machine/account.

Additional investigation:

  • Cleared ~/.claude/usage-data/session-meta/ cache entirely — did not fix it
  • 32 qualifying sessions (≥2 messages, ≥1 min duration) exist with transcripts available
  • Interactive sessions work perfectly; only the background non-interactive facet extraction fails
  • No ANTHROPIC_API_KEY env var set; using OAuth

Workaround

The session-report plugin (claude plugin install session-report) works correctly as an alternative — it uses a standalone Node.js analyzer script that doesn't depend on background LLM calls.

Request

Please surface the actual error from facet extraction somewhere accessible (e.g. a --debug flag output or a log file) so users can diagnose why it fails without needing to inspect the binary.

View original on GitHub ↗

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