Turn your Claude Code /insight reports into actionable improvements.
Parses insight HTML reports and generates prioritized to-dos, CLAUDE.md rules, hook settings, MCP server recommendations, and custom skills β all tailored to your usage patterns.
# Install globally
npm install -g claude-insights
# Auto-detect report and apply improvements
claude-insights analyze --applyThat's it. Your CLAUDE.md, settings, and skills are updated automatically.
| Version | Highlights |
|---|---|
| v1.4 | π skill audit β validate SKILL.md files against the Claude Skills Guide, scored reports, auto-fix |
| v1.3 | π·οΈ Friction annotations & false-positive filtering, domain-classified skills, natural examples |
| v1.1 | π Auto-apply, trend tracking, watch mode, team aggregation, MCP recommendations, advanced hooks |
# Standard mode β generate output files
claude-insights analyze path/to/report.html -o ./my-project
# Auto-apply β merge directly into your project (dedup-aware)
claude-insights analyze path/to/report.html --apply
# With session facet enrichment
claude-insights analyze path/to/report.html --apply --facets
# Wait for report (while /insight runs in Claude Code)
claude-insights analyze --wait --apply
# Watch mode β re-run on report changes
claude-insights watch path/to/report.html -o ./my-projectWhen no file is given, the CLI looks for the report at ~/.claude/usage-data/report.html automatically.
# These are equivalent:
claude-insights analyze
claude-insights analyze ~/.claude/usage-data/report.html| Command | Description |
|---|---|
π analyze [file] |
Parse report and generate output files |
π analyze [file] --apply |
Parse and auto-merge into project (dedup-aware) |
π analyze [file] --facets |
Enrich with session facet data |
β³ analyze --wait |
Wait for report to appear, then analyze |
π watch <file> -o <dir> |
Watch report file and re-run on changes |
π history |
List past analysis runs |
π diff <date1> <date2> |
Compare two analysis runs by date |
π₯ team <files...> -o <dir> |
Aggregate multiple team reports |
π·οΈ annotate |
Interactive friction annotation walkthrough |
π skill audit [path] |
Audit SKILL.md files against best practices |
π§ skill audit --fix |
Auto-fix all fixable issues |
| Flag | Commands | Description |
|---|---|---|
-o, --output-dir <path> |
analyze, watch | Output directory |
--apply |
analyze, watch | Merge directly into project |
--facets [dir] |
analyze, watch | Include session facet data |
--wait [seconds] |
analyze | Wait for report (default 300s) |
| File | What it gives you |
|---|---|
π insights-todo.md |
Prioritized task table with steps, time estimates, and friction reduction |
π CLAUDE.md-additions.md |
Ready-to-paste rules organized by section (General, CSS, Testing, Debugging) |
βοΈ .claude/settings-insights.json |
Hook configurations and MCP server recommendations |
π― .claude/skills/<name>/SKILL.md |
Generated skills following the Agent Skills standard |
π insights-README.md |
Placement guide for generated files |
Use --apply to merge output directly into your project:
claude-insights analyze report.html --apply -o ./my-project| Target | Behavior |
|---|---|
| CLAUDE.md | Appends new rules under ## Claude Insights Additions. 80% word-overlap dedup β existing rules are skipped |
| settings.json | Deep-merges into .claude/settings.json. Hooks merge by event key, MCP servers by name |
| Skills | Placed into .claude/skills/<name>/SKILL.md. Overwrites on update |
Safe to run multiple times. Duplicates are detected and skipped.
Generated skills follow the agentskills.io open standard:
.claude/skills/
fix-css/
SKILL.md
debug-structured/
SKILL.md
insights-review/
SKILL.md
Each skill includes:
- Three-part description β what, when to use (with scenarios), and negative triggers
- Domain-specific steps β tailored to the friction domain (CSS, debugging, testing)
- "What Goes Wrong" section β real failure narratives from your sessions
- Verification checklist β gates that reference past failures before completion
- Argument hints β e.g.
<file-or-component-path>for CSS skills
Compatible with Claude Code, Cursor, Codex CLI, and VS Code Copilot.
Validate any SKILL.md against the official Claude Skills Guide:
claude-insights skill audit # Auto-detect .claude/skills/
claude-insights skill audit path/to/skill/ # Audit one skill
claude-insights skill audit --fix # Auto-fix all fixable issues
claude-insights skill audit --json # JSON output for CI| Severity | Impact | Examples |
|---|---|---|
| π΄ Critical (score = 0) | Missing frontmatter, invalid name, reserved name, XML in frontmatter | 7 checks |
| π‘ High (-10 each) | Missing action verb, triggers, negative triggers, steps, examples | 6 checks |
| π’ Medium (-5 each) | Missing metadata, troubleshooting, word count, file references | 4 checks |
--fix surgically modifies SKILL.md files β only inserts or appends, never deletes:
- Frontmatter: Injects
allowed-tools,metadatafields - Description: Appends negative triggers
- Body: Appends
## Troubleshootingsection
Every analysis is saved to ~/.claude-insights/history/:
claude-insights history # List past runs
claude-insights diff 2026-01-15 2026-02-15 # Compare two runsShows friction count changes, resolved vs. new patterns, and directional summary.
Aggregate multiple /insight reports into shared team insights:
claude-insights team alice.html bob.html carol.html -o ./team-output- Identifies shared frictions across team members with attribution
- Rules in 2+ reports receive higher priority
- Generates combined skills, todos, and CLAUDE.md rules
Refine output over time by marking frictions:
claude-insights annotate # Interactive walkthrough
claude-insights annotate --false-positive "CSS Issues" # Mark as false positive
claude-insights annotate --useful "Debugging Failures" # Mark as useful
claude-insights annotate --list # View annotations
claude-insights annotate --clear # Clear allFalse-positive frictions are filtered from future runs. Annotations persist at ~/.claude-insights/annotations.json with fuzzy 80% word-overlap matching.
The analyzer maps friction patterns to relevant MCP servers (Playwright, PostgreSQL, Fetch, Filesystem, Git):
- Server description and install command
- Ready-to-paste config for
.claude/settings.json - Matched frictions explaining why it was recommended
In --apply mode, MCP configs are merged automatically (existing servers preserved).
Hooks are generated from friction patterns across lifecycle events:
| Event | When it fires |
|---|---|
PreToolUse |
Before Claude uses a tool (e.g., check patterns before CSS edits) |
PostToolUse |
After tool use (e.g., run tests after edits) |
Stop |
Before completing a task (e.g., verify root cause evidence) |
In --apply mode, hooks deep-merge by event key β existing hooks preserved.
Report HTML βββΆ Parse (cheerio) βββΆ Filter (annotations) βββΆ Enrich (facets)
β
βΌ
Analyze βββΆ Prioritized todos, CLAUDE.md rules, skills, hooks, MCP configs
β
βΌ
Generate / Apply βββΆ Write files or merge into project (dedup-aware)
β
βΌ
Track βββΆ Save history, show trend report vs. previous run
| Component | Technology |
|---|---|
| π HTML Parsing | cheerio |
| π» CLI | Commander.js |
| π¬ Prompts | node:readline |
| π File Watching | node:fs watch |
| π§ͺ Testing | Vitest |
| π Language | TypeScript, Node.js 20+ |
Preferred β automatic with dedup:
claude-insights analyze report.html --applyManual β review before placing:
- Copy rules from
CLAUDE.md-additions.mdinto yourCLAUDE.md - Merge
settings-insights.jsoninto.claude/settings.json - Copy
.claude/skills/directories into your project - Start a new Claude Code session and test
Contributions welcome! Feel free to open issues or submit pull requests.
MIT
Built with β€οΈ for the Claude Code community
Stop repeating mistakes. Start learning from them.