Audit Your Coding Habits with /insights
When you’re busy writing, you rarely stop to look at how you actually use your tools.
I’d been using Claude Code for a while, feeling pretty good about it. Then a friend said: “Try /insights.”
Start claude, hop into a session, and type:
/insights
Wait a few dozen seconds, and an HTML report pops up in your browser. It analyzes your last 30 days of Claude Code sessions and breaks them down: which projects you spent time on, which tools you used most, language distribution, and — the punchline — where your workflow is wasting tokens.
All data comes from local ~/.claude/ session logs. The report never leaves your 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 you right away how much you’re actually using it.
Usage Patterns
The report uses bar charts to show several dimensions:
- Most-used tools: How many times you hit Edit, what percentage went to Bash vs Read vs Write
- Language breakdown: TypeScript, Python, Markdown — the split can surprise you
- 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 you work. Not just numbers — actual natural language analysis.
It might say something like: “You lean toward iterative work — despite some friction, your satisfaction skews positive, meaning you treat iteration as part of the process rather than failure.” Hearing that about yourself from your own data is oddly compelling.
There’s also a time-of-day chart showing when you’re most active.
Friction Points
This is where it gets real. The report identifies patterns where you’re losing time, ranked by frequency, with examples pulled from your actual sessions.
Common patterns include:
- Jumping in too early: Claude starts coding before fully understanding what you want. But really, it’s your fault — your prompts lack clear constraints.
- Re-explaining context every session: You spend the first 2-3 messages in every new session explaining your project setup, even though you have a perfectly good
CLAUDE.md. It happens to the best of us.
Each friction point comes with timestamps and session IDs. No hiding.
Actionable Suggestions
The report generates rules you 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 you do next.
Update Your CLAUDE.md
Drop the suggested rules into your project’s CLAUDE.md. Next session, Claude follows them automatically — no more repeating yourself.
Create Custom Commands
If the report shows you doing the same type of task over and over, 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, just type /debug.
Fix Your Prompting Habits
If first-attempt success rates are low, your prompts are probably too vague. “make this better” → “refactor this function to reduce cyclomatic complexity”. 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 schedule 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 you “last month it was 73%, this month it’s 12%”
- If it errors:
ctrl + cto exit, reopen, and make sure you’re on the latest version
Even with these limitations, it’s the most useful self-assessment tool I’ve used.
Add /insights to your monthly routine. When you run it the second time, open the old report and compare — see what actually improved.