Skip to main content
command CX Codex

insights · rohitg00 — Claude Code command: session and learning analytics

insights turns your pro-workflow history into numbers: edits per session, rules you actually apply, mistakes that keep coming back. Useful when you want to see where the agent keeps slipping.

MIT ★ 2,966 updated 2026-09-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow
Open on GitHub

What insights does

/insights prints a report on how the current session went and how the rules captured by pro-workflow are holding up. Bare /insights gives the whole picture, while session, learnings, corrections and heatmap narrow it to one slice. Adding --export writes the report out as markdown.

The figures come from SQLite queries against ~/.pro-workflow/data.db: categories ranked by count, correction rate per project, rules applied most often, rules written and never used. No database means nothing to report on, so run it once pro-workflow has logged some sessions.

The heatmap also covers adaptive quality gates: the edit threshold loosens as the correction rate drops. It points at fixes too, like adding a path rule to CLAUDE.md or saving a recurring pattern through /learn-rule.

What it helps with

  • see how many edits one session produced
  • find rules that were captured but never applied
  • spot categories where corrections pile up
  • compare correction rates across projects
  • export the report as a markdown file

Example prompts for the agent

  • Run /insights session and tell me the edit and correction count for this session.
  • Show /insights heatmap so I can see which categories get corrected most.
  • Export everything with /insights --export and save the report.

How to install insights

1Plugin marketplace

/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow

2Manually: put the files in place

.claude/commands/insights.md

Call it with /insights. For all projects use ~/.claude/commands/

Questions about insights

How do I install insights in Claude Code?

Add the marketplace with /plugin marketplace add rohitg00/pro-workflow, then run /plugin install pro-workflow@pro-workflow. The command file ends up at .claude/commands/insights.md.

What does insights do?

It reports on session activity, the learnings database and recurring correction patterns. The session, learnings, corrections and heatmap subcommands show one view each.

Where does insights get its data?

From the SQLite file ~/.pro-workflow/data.db, which pro-workflow fills as you work. Queries against it count categories, correction rates per project and how often each rule is applied.

Source text

insights.md · MIT
---
description: Analyze session history, captured learnings, and correction patterns.
---

# /insights - Session & Learning Analytics

Surface patterns from your pro-workflow learnings and session history.

## Usage

```
/insights
/insights session
/insights learnings
/insights corrections
/insights heatmap
```

## What It Shows

### Session Summary

Current session stats:
```
Session Insights
  Duration: 47 min
  Edits: 23 files modified
  Corrections: 2 self-corrections applied
  Learnings: 3 new patterns captured
  Context: 62% used (safe)
```

### Learning Analytics

Query the learnings database for patterns:
```
Learning Insights (42 total)

Top categories:
  Testing     12 learnings (29%)
  Navigation   8 learnings (19%)
  Git          7 learnings (17%)
  Quality      6 learnings (14%)
  Editing      5 learnings (12%)
  Other        4 learnings (10%)

Most applied:
  #12 [Testing] Run tests before commit — 15 times
  #8  [Navigation] Confirm path for common names — 11 times
  #23 [Git] Use feature branches always — 9 times

Recent learnings (last 7 days):
  #42 [Claude-Code] Compact at task boundaries
  #41 [Prompting] Include acceptance criteria
  #40 [Architecture] Plan before multi-file edits

Stale learnings (never applied):
  #15 [Editing] Prefer named exports — 0 times (45 days old)
  #19 [Context] Ask before large refactors — 0 times (30 days old)
```

### Correction Patterns

Show what types of mistakes are recurring:
```
Correction Patterns

Most corrected areas:
  File navigation    5 corrections
  Test coverage      3 corrections
  Commit messages    2 corrections

Trend: Navigation errors decreasing (5 → 2 per week)
Trend: Testing corrections stable (1 per week)

Suggestions:
  - Add path confirmation rule to CLAUDE.md (3+ corrections)
  - Consider /learn-rule for test patterns
```

### Correction Heatmap

Show which files and patterns get corrected most across all sessions:
```
Correction Heatmap

By category (all time):
  ████████████ Testing      34 corrections
  ████████     Navigation   22 corrections
  ██████       Git          18 corrections
  ████         Quality      12 corrections
  ███          Editing       9 corrections
  ██           Architecture  6 corrections

By project:
  my-api         corrections_rate: 23%  (high — review patterns)
  my-frontend    corrections_rate: 8%   (healthy)
  my-cli         corrections_rate: 4%   (excellent)

Adaptive quality gates:
  Current threshold: 5 edits (tighter — 18% correction rate)
  If rate drops below 15%: gates relax to 8 edits
  If rate drops below 5%: gates relax to 10 edits

Hot learnings (most corrected, least learned):
  - [Testing] Mock external dependencies — corrected 8x, learned 0x
    → Consider: /learn-rule to capture this permanently
  - [Navigation] Check file exists before editing — corrected 5x, learned 1x
    → Pattern keeps recurring despite learning

Cold learnings (learned but never applied):
  - [Editing] Use named exports — learned 45 days ago, applied 0x
    → Consider removing if no longer relevant
```

### Productivity Metrics

```
Productivity (last 10 sessions)

  Avg session: 35 min
  Avg edits/session: 18
  Correction rate: 12% (improving)
  Learning capture: 2.1 per session

  Best session: 2026-02-01 (28 edits, 0 corrections)
  Most productive hour: 10-11am
```

## How to Query

Run these SQLite queries against `~/.pro-workflow/data.db`:

**Heatmap by category:**
```sql
SELECT category, COUNT(*) as count
FROM learnings
WHERE mistake IS NOT NULL
GROUP BY category
ORDER BY count DESC
```

**Correction rate by project:**
```sql
SELECT project,
  SUM(corrections_count) as total_corrections,
  SUM(edit_count) as total_edits,
  ROUND(CAST(SUM(corrections_count) AS FLOAT) / NULLIF(SUM(edit_count), 0) * 100, 1) as rate
FROM sessions
WHERE project IS NOT NULL
GROUP BY project
ORDER BY rate DESC
```

**Hot learnings (most corrected patterns):**
```sql
SELECT category, rule, times_applied,
  (SELECT COUNT(*) FROM sessions WHERE corrections_count > 0) as correction_sessions
FROM learnings
WHERE mistake IS NOT NULL
ORDER BY times_applied ASC, created_at ASC
LIMIT 10
```

## Options

- **session**: Current session stats only
- **learnings**: Learning database analytics
- **corrections**: Correction pattern analysis
- **heatmap**: Correction heatmap across categories, projects, and files
- **all**: Full report including heatmap (default)
- **--export**: Output as markdown file

## Related Commands

- `/list` - Browse all learnings
- `/search <query>` - Find specific learnings
- `/learn-rule` - Capture a new learning
- `/replay` - Surface learnings for current task
- `/wrap-up` - End-of-session with learning capture

---

**Trigger:** Use when user asks "show stats", "how am I doing", "what patterns", "analytics", "insights", "heatmap", "correction rate", or wants to understand their learning trajectory.

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

insights by other authors comes first.

insights Son Nguyen The insights command reads Agent Monitor data and reports three high-impact findings about Claude Code usage. Use it to spot activity shifts, cache patterns, or API errors. CX Codex +1 ★ 1,198repo stars recall arjunkmrm recall is a Claude Code skill that searches past Claude Code, Codex, pi and Grok sessions with BM25. Search a query or list sessions to find earlier discussions with an agent. CX Codex +1 583installs insights-advisor Son Nguyen insights-advisor is a Claude Code subagent that examines Agent Monitor data and connects patterns across sessions. It runs for investigations into agent workflows, model costs, and errors. CX Codex ★ 1,198repo stars ccam-insights Son Nguyen ccam-insights — a Claude Code plugin that detects patterns in agent behavior, alerts on anomalies, and provides optimization recommendations. Uses Agent Monitor analytics to compare sessions and spot deviations. CX Codex ★ 1,198repo stars get-token-insights Samarth Gupta get-token-insights parses Claude Code conversation history, flags token waste, and generates an offline dashboard covering costs, hooks, and agent workflows. CX Codex +1 ★ 276repo stars turning-engineering-analytics-into-insights PostHog turning-engineering-analytics-into-insights — a skill for Claude Code and Codex: converts PR and CI metrics into saved PostHog insights, dashboards, and automated subscriptions. Triggers when visualizing engineering team performance. CX Codex +1 189installs creator-insights Starchild-ai-agent The creator-insights skill analyzes Twitter/X accounts, spots viral patterns and high-value followers, and drafts tweets. Use it for creator research and niche analysis. CX Codex +1 151installs

From the same set83

The whole set →
llm-council llm-council runs multi-model deliberation in three stages: parallel drafts, anonymous peer rankings, and final synthesis by a designated chairman. CX Codex +1 ★ 2,966repo stars design-engineering The design-engineering skill guides interface animation choices and UI reviews. Use it when refining a component, transition, modal, or other interactive state. CX Codex +1 ★ 2,966repo stars permission-tuner The permission-tuner skill reads permission prompts and auto mode denials from your session logs, then suggests permission rules and autoMode entries to reduce interruptions. CX Codex +1 ★ 2,966repo stars batch-orchestration batch-orchestration decomposes large codebase changes into independent units and runs parallel agents in isolated git worktrees. CX Codex +1 ★ 2,966repo stars doctor doctor scans your pro-workflow and Claude Code setup: checks hooks, database, context usage, MCP servers, and git state. Spots broken hook scripts and settings conflicts before they cause problems. CX Codex +1 ★ 2,966repo stars thoroughness-scoring thoroughness-scoring rates implementation choices from 1 to 10 and prompts the agent to pick thorough solutions with tests and typing over brittle shortcuts. CX Codex +1 ★ 2,966repo stars skill-optimizer The skill-optimizer skill proposes edits to a SKILL.md based on stored corrections, then checks candidates against held-out examples before accepting changes. CX Codex +1 ★ 2,966repo stars agent-teams agent-teams is a Claude Code skill that coordinates multiple sessions through shared tasks, messaging, and file locks. Teammates work in parallel on separate parts of the codebase. CX Codex +1 ★ 2,966repo stars

Project sponsors

Companies that keep this analytics open