Auditing My Coding Habits with /insights

When I’m busy writing, I rarely stop to look at how I actually use my tools.

I’d been using Claude Code for a while, feeling pretty good about it. Then a friend said: “Try /insights.”

I start claude, hop into a session, and type:

/insights

A few dozen seconds later, an HTML report pops up in my browser. It analyzes my last 30 days of Claude Code sessions and breaks them down: which projects I spent time on, which tools I used most, language distribution, and — the punchline — where my workflow is wasting tokens.

All data comes from local ~/.claude/ session logs. The report never leaves my machine.

What’s in the Report

At a Glance

A summary card at the top shows core stats: session count, total messages, lines changed, active days.

The first time I ran it, I got 38 sessions, 659 messages, 22 active days. Tells me right away how much I’m actually using it.

Usage Patterns

The report uses bar charts to show several dimensions:

  • Most-used tools: How many times I hit Edit, what percentage went to Bash vs Read vs Write
  • Language breakdown: TypeScript, Python, Markdown — the split can surprise me
  • Task types: Code generation, debugging, refactoring, test writing
  • Session duration: Average session length, average response time

When I saw I spent 18% of my time writing Markdown, I had to rethink my workflow.

Working Style Analysis

The report generates a paragraph describing how I work. Not just numbers — actual natural language analysis.

It might say something like: “I lean toward iterative work — despite some friction, my satisfaction skews positive, meaning I treat iteration as part of the process rather than failure.” Hearing that about myself from my own data is oddly compelling.

There’s also a time-of-day chart showing when I’m most active.

Friction Points

This is where it gets real. The report identifies patterns where I’m losing time, ranked by frequency, with examples pulled from my actual sessions.

Common patterns include:

  • Jumping in too early: Claude starts coding before fully understanding what I want. But really, it’s my fault — my prompts lack clear constraints.
  • Re-explaining context every session: I spent the first 2-3 messages in every new session explaining my project setup, even though I have a perfectly good CLAUDE.md. It’s a trap I kept falling into.

Each friction point comes with timestamps and session IDs. No hiding.

Actionable Suggestions

The report generates rules I can copy straight into CLAUDE.md. For the “jumping in too early” problem:

  • State clear constraints before asking for a solution
  • Use plan mode to force Claude to propose before executing

For the “re-explaining context” problem:

## General Rules
- Before starting a task, read CLAUDE.md for project context
- If the task needs project background, confirm it in CLAUDE.md first

Turning Insight into Action

Running /insights once is just the start. The real value comes from what I do next.

Update My CLAUDE.md

I drop the suggested rules into my project’s CLAUDE.md. Next session, Claude follows them automatically — no more repeating myself.

Create Custom Commands

If the report shows me doing the same type of task over and over, I wrap it in a custom command:

# .claude/commands/debug.md

Debug an issue. List three possible causes ranked by likelihood,
then investigate each one.

Next time, I just type /debug.

Fix My Prompting Habits

If first-attempt success rates are low, my prompts are probably too vague. Changing “make this better” to “refactor this function to reduce cyclomatic complexity” made a big difference.

Automate It

Run /insights in non-interactive mode to script the whole process:

claude -p "/insights" --output-format json \
  | claude -p "extract friction points and suggestions, check if CLAUDE.md already has them, append if not"

Then I scheduled it with crontab or /loop 30d.

Caveats

/insights isn’t perfect:

  • Fixed 30-day window: Can’t look at just the past week or quarter
  • Mixed recommendation quality: Some are copy-paste ready, others are vague
  • Slow for heavy users: 150+ sessions takes 45-60 seconds to generate
  • No team view: Personal only, no aggregation
  • No diff between runs: Won’t tell me “last month it was 73%, this month it’s 12%”
  • If it errors: I hit ctrl + c, reopen, and make sure I’m on the latest version

Even with these limitations, it’s the most useful self-assessment tool I’ve used.

I added /insights to my monthly routine. When I run it the second time, I open the old report and compare — and see what actually improved.

Article Link:

https://time-friend.com/en/archive/claude-code-insights/

# Related Articles