docs: integrate /insights architecture from Zolkos deep dive (4/5)

1. Resource evaluation (docs/resource-evaluations/zolkos-insights-deep-dive.md):
   - Score: 4/5 (High Value) - comprehensive technical architecture
   - Content: 7-stage pipeline, facets classification (6 dimensions), technical specs
   - Decision: Integrate architecture + facets (complementary with usage doc)
   - Comparison: Zolkos (architecture interne) vs Guide (usage externe) = complet
   - Why not 5/5: Missing user guidance, screenshots, prompt examples
   - Updated index: 23 evaluations total

2. Architecture Overview added to guide (ultimate-guide.md L6460+):
   - 7-stage pipeline: filtering, summarization, facet extraction, aggregation,
     executive summary, report generation, facet caching
   - Facets Classification System (6 dimensions):
     * Goals (13 types): Debug, Implement, Fix Bug, Write Script, Refactor, etc.
     * Friction (12): Misunderstood, wrong approach, buggy code, user rejection, etc.
     * Satisfaction (6): Frustrated → Dissatisfied → Likely → Satisfied → Happy
     * Outcomes (4): Not → Partially → Mostly → Fully Achieved
     * Success (7): Fast search, correct edits, explanations, proactive, multi-file, etc.
     * Session Types (5): Single, multi, iterative, exploration, quick question
   - Performance: Caching system (facets/<session-id>.json) for incremental analysis
   - Interpretation guidance: How facets help understand report recommendations
   - Source attribution: Zolkos Technical Deep Dive (2026-02-04)

3. CHANGELOG [Unreleased]:
   - Comprehensive /insights documentation with architecture deep dive
   - Facets classification system (6 dimensions documented)
   - Performance optimization explanation (caching)
   - Resource evaluation: Zolkos deep dive (4/5, integrated)

Impact: Power users can now understand WHY /insights generates specific suggestions
(based on facets classification), optimize workflows for better analysis (avoid <2 msg
sessions), and interpret friction categories with context (12 types documented).

Complementarity proven: Usage documentation (existing) + Architecture (Zolkos) = complete.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Florian BRUNIAUX 2026-02-06 15:38:45 +01:00
parent 669199e215
commit bd01add3f6
4 changed files with 423 additions and 10 deletions

View file

@ -6459,6 +6459,49 @@ Never proceed with a broken build.
- **Data location**: `~/.claude/usage-data/` (sessions stored as JSONL)
- **Privacy**: All analysis runs locally; no data sent to external services beyond standard Claude Code API usage
#### How /insights Works (Architecture Overview)
The analysis pipeline processes session data through 7 stages:
1. **Session Filtering**: Loads from `~/.claude/projects/`, excludes agent sub-sessions, sessions with <2 user messages, or <1 minute duration
2. **Transcript Summarization**: Chunks sessions exceeding 30,000 characters into 25,000-character segments
3. **Facet Extraction**: Uses Claude Haiku to classify sessions into structured categories
4. **Aggregated Analysis**: Detects cross-session patterns and recurring workflows
5. **Executive Summary**: Generates "At a Glance" synthesis across four dimensions
6. **Report Generation**: Renders interactive HTML with visualizations and narrative sections
7. **Facet Caching**: Saves classifications to `~/.claude/usage-data/facets/<session-id>.json` for fast subsequent runs
**Facets Classification System**:
The system categorizes sessions using these dimensions:
**Goals (13 types)**:
Debug/Investigate, Implement Feature, Fix Bug, Write Script/Tool, Refactor Code, Configure System, Create PR/Commit, Analyze Data, Understand Codebase, Write Tests, Write Docs, Deploy/Infra, Cache Warmup
**Friction Types (12 categories)**:
Misunderstood requests, Wrong approach, Buggy code, User rejected actions, Claude blocked, Early user stoppage, Wrong file locations, Over-engineering, Slowness/verbosity, Tool failures, Unclear requests, External issues
**Satisfaction Levels (6)**:
Frustrated → Dissatisfied → Likely Satisfied → Satisfied → Happy → Unsure
**Outcomes (4 states)**:
Not Achieved → Partially Achieved → Mostly Achieved → Fully Achieved
**Success Categories (7)**:
Fast accurate search, Correct code edits, Good explanations, Proactive help, Multi-file changes, Good debugging, None
**Session Types (5)**:
Single task, Multi-task, Iterative refinement, Exploration, Quick question
Understanding these categories helps interpret your report:
- High "Buggy code" friction → Consider implementing pre-commit hooks (see Hooks feature)
- Low satisfaction on "Implement Feature" goals → Improve planning phase specificity
- "Early user stoppage" pattern → May indicate requests lack sufficient context
**Performance optimization**: The caching system ensures subsequent runs only analyze new sessions (not previously classified ones), making regular monthly runs fast even with large session histories.
> **Source**: Architecture details from [Zolkos Technical Deep Dive](https://www.zolkos.com/2026/02/04/deep-dive-how-claude-codes-insights-command-works.html) (2026-02-04)
#### Limitations
- **Requires history**: Needs at least ~10 sessions for meaningful patterns