How to generate a Claude Code usage-habits report with /insights
Run /insights in Claude Code to get an HTML report built from your recent sessions on this machine. It looks at how you work rather than how many tokens you used: what you work on, friction points such as misunderstood requests or buggy code, and suggestions for using Claude Code more effectively.
/insights
- A single run analyzes up to 200 sessions it hasn't seen before and skips very short ones. When sessions are left out, the report header shows the analyzed count with the total in parentheses, for example
200 sessions (412 total). - The latest report is written to
~/.claude/usage-data/report.html, and each run also saves a timestamped copy in the same directory, so earlier reports aren't overwritten. On a Mac, open it like this.
open ~/.claude/usage-data/report.html
- Reports are deleted on the same schedule as the rest of your session data: at startup, Claude Code removes files older than
cleanupPeriodDays(30 days by default). Copy a report elsewhere if you want to keep it.
If auto mode is available to the session and your recent sessions mostly ran without it, the report can also estimate how many permission prompts auto mode could have handled.
It works on any plan and with any provider. The analysis runs through the same provider and account as your regular sessions, so its tokens count against your plan or API usage. Sessions from other devices and claude.ai aren't included, and the command isn't available in cloud sessions.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.