How to Use the /insights Command in Claude Code to Audit Your AI Workflow Anthropic's Claude Code now includes a `/insights` command that generates a 30-day HTML report analyzing developer usage patterns, token consumption, and session behavior. The built-in audit tool surfaces which tasks consume the most resources and identifies repeated request patterns that could be templated or automated, helping developers optimize their AI workflow efficiency. How to Use the /insights Command in Claude Code to Audit Your AI Workflow The /insights command generates a 30-day HTML report on your Claude Code usage, surfacing what's working, what's slowing you down, and what to build next. What the /insights Command Actually Does If you’ve been using Claude Code for any length of time, you’ve probably wondered: am I using this tool well? Are certain types of tasks eating more tokens than they should? Am I repeating the same kinds of requests over and over — the kind that could be templated or automated? The /insights command in Claude Code gives you a direct answer. Run it once, and Claude Code generates a 30-day HTML report breaking down your usage patterns, session behavior, token consumption, and more. It’s a built-in workflow audit — and most developers either don’t know it exists or haven’t looked at the output carefully enough to act on it. This guide walks through what /insights shows you, how to read it, and — more importantly — what to do with what you find. How to Run the /insights Command Using /insights is straightforward. Inside any Claude Code session, type: /insights Claude Code will generate an HTML file and either open it in your browser automatically or give you the path to open it yourself. The report covers the 30 days prior to when you run the command. A few things to know before you run it: You need an active Claude Code session. The command runs inside the CLI, not from your terminal standalone. Usage data is stored locally. Claude Code logs session activity on your machine, which is what the report draws from. Nothing is sent to Anthropic’s servers to generate this. The report is a snapshot. It reflects the 30-day window as of the moment you run it. If you run it again next week, the window shifts. You can run it in any project directory. The report aggregates usage globally across all your Claude Code sessions, not just the current project. Built like a system. Not vibe-coded. Remy manages the project — every layer architected, not stitched together at the last second. That’s the full setup. No configuration required. What’s Inside the Report The HTML report is dense but well-organized. Here’s a breakdown of the major sections and what each one tells you. Session Summary This section gives you high-level numbers: total sessions over the past 30 days, average session length, and total active time. It’s the baseline — useful for understanding how heavily you’re actually using Claude Code versus how heavily you think you are. A lot of developers are surprised here. Either they’re running far more sessions than expected often a sign of fragmented, interrupt-driven use , or sessions are longer than they realized which can indicate unclear prompts that require a lot of back-and-forth to resolve . Token Usage Breakdown This is usually the most actionable section. The report shows: Total tokens used across all sessions Input vs. output token split Average tokens per session Sessions with the highest token consumption High input token counts relative to output typically mean you’re pasting a lot of context into your prompts — sometimes more than necessary. High output counts might mean you’re generating large code blocks repeatedly, which could be templated. If you’re on a paid Claude plan, this section also maps to cost, so you can see where your budget is actually going. Task Category Patterns Claude Code attempts to categorize your requests — things like code generation, debugging, refactoring, explanation, test writing, and so on. The insights report shows the distribution across these categories. This is where most developers find the clearest signal. If 60% of your sessions are debugging requests, that’s useful information: either your codebase has structural issues worth addressing, or you’re using Claude Code reactively rather than proactively. Repeated Patterns and Common Queries The report surfaces prompts or prompt structures that recur frequently. It won’t show the exact text of every request, but it identifies clusters — similar phrasing, similar task types, similar contexts. If you see the same pattern appearing 15 times in a month, that’s a strong candidate for a CLAUDE.md instruction, a custom slash command, or an automated workflow. Session Efficiency Metrics This section breaks down what percentage of your sessions reached a useful output on the first attempt versus required multiple follow-ups or corrections. Low first-attempt success rates are a direct flag that your prompt construction needs work. You’ll also see data on abandoned sessions — where you started a task but didn’t use the output. That’s often a sign of misaligned expectations or unclear task framing going in. How to Read the Report Without Getting Lost in It The report generates a lot of data. It’s easy to open it, feel vaguely informed, and close it without changing anything. Here’s a more structured approach. Look for the Three Biggest Outliers First Don’t try to optimize everything at once. Scan for the three data points that look most unusual or most expensive — whichever metric matters most to you, whether that’s time, tokens, or repetition. Common outliers to watch for: One or two sessions with 5x the average token count. What were you doing? Was it worth it? A task category that dominates unexpectedly. If you thought you were using Claude Code mainly for generation but the report shows 70% debugging, your mental model is off. High rates of abandoned or multi-round sessions. That’s friction — and friction compounds. Remy doesn't write the code. It manages the agents who do. Remy runs the project. The specialists do the work. You work with the PM, not the implementers. Look for Patterns Worth Systemizing The repeated patterns section is where you find workflow automation candidates. Ask yourself: if I do this task 15 times in a month, what would happen if I spent two hours building a proper workflow around it? Some tasks are worth keeping ad hoc. Others — especially ones that follow predictable input/output structures — are better handled by a pre-configured workflow or template. Check the Trend Direction If you’ve run /insights before, compare the current report to previous ones save your HTML files somewhere . Are your session efficiency metrics improving? Is token consumption per task going down? Are abandoned sessions decreasing? The goal isn’t perfection — it’s directional improvement over time. Common Issues the Report Surfaces Based on common usage patterns, here are the problems that /insights tends to flag most frequently. Over-Prompting with Excessive Context Many developers paste entire files, entire error logs, or long documentation blocks into every Claude Code request — even when only a small portion is relevant. The report flags this through abnormally high input token ratios. The fix is usually learning to scope context better: include only the relevant function, the relevant error, the relevant section. Claude Code handles targeted context far more efficiently than large dumps. Debugging the Same Errors Repeatedly If the task category report shows recurring debugging sessions around similar error types, you have a few options: address the root cause in the codebase, add better error handling, or build a prompt template that helps Claude Code resolve that specific error class faster. Misusing Claude Code for Simple Tasks Not every task needs Claude Code. The report sometimes shows clusters of very short sessions with minimal token use — tasks that could be handled by a simple script, a linter, or a different tool entirely. Recognizing those is part of working efficiently. Low First-Attempt Success Rate If your session efficiency metrics show a lot of back-and-forth, the issue is almost always prompt construction. The most common culprits: - Vague task descriptions “make this better” vs. “refactor this function to reduce cyclomatic complexity” - Missing constraints “generate a function” vs. “generate a function that fits within this existing interface” - No examples when the output format matters A CLAUDE.md file that captures your project conventions and preferences can significantly lift first-attempt accuracy. Turning Insights Into Action Reading the report is the easy part. Acting on it requires a bit of structure. Build or Update Your CLAUDE.md The CLAUDE.md file in your project root is one of the most underused features in Claude Code. It persists instructions across sessions — project conventions, preferred libraries, code style, things Claude Code should always or never do. After running /insights , treat the repeated patterns section as your CLAUDE.md input list. If you’re consistently specifying the same constraints, preferences, or context, those belong in CLAUDE.md, not in every individual prompt. Create Custom Slash Commands for High-Frequency Tasks Claude Code supports custom slash commands via your .claude/commands/ directory. If /insights surfaces a task you run 10–15 times a month with consistent structure, turn it into a custom command. For example, if you frequently ask Claude Code to audit a function for performance issues using a specific framework, that’s a 10-minute setup for a custom command that saves time every subsequent use. Adjust Your Session Approach for Longer Tasks If long sessions are bleeding token costs, consider breaking complex tasks into smaller, well-scoped sessions rather than trying to resolve everything in one go. The report often reveals that single large sessions are less efficient than a sequence of focused ones. Identify Tasks That Belong Outside Claude Code Some things you’re doing in Claude Code would be better handled elsewhere — especially repetitive, structured tasks that don’t require active reasoning but just need consistent execution. This is where platforms built for workflow automation come in. Where MindStudio Fits Into Your Claude Code Workflow Once /insights surfaces your repetitive, structured tasks, the question becomes: what do you do with them? For tasks that follow a clear pattern — take this input, process it this way, produce this output — you don’t need an interactive coding assistant. You need an automated workflow. That’s where MindStudio https://mindstudio.ai is genuinely useful. MindStudio is a no-code platform for building AI agents and automated workflows. After running your /insights audit, you might find that a significant chunk of your Claude Code sessions are things like: - “Summarize this PR diff and write a plain-language description” - “Convert this JSON schema to TypeScript types” - “Generate test cases for this function signature” - “Review this error log and suggest likely causes” Each of those is a candidate for a MindStudio workflow. You configure it once — pick a model from MindStudio’s 200+ options, build the prompt structure, set the input/output format — and then it runs on demand without requiring an interactive session. You can trigger it from a webhook, from Slack, from a scheduled job, or from your own application. For developers specifically, MindStudio’s Agent Skills Plugin https://mindstudio.ai/agent-skills @mindstudio-ai/agent lets Claude Code itself call MindStudio workflows as typed method calls — meaning you can offload stable, well-defined tasks to a dedicated workflow and keep Claude Code focused on the reasoning-heavy work it does best. The combination is practical: use /insights to identify what’s routine and repetitive, then move those tasks into MindStudio. What remains in Claude Code is the work that actually benefits from active, interactive AI assistance. You can start building on MindStudio free at mindstudio.ai https://mindstudio.ai . Frequently Asked Questions What does the /insights command generate? The /insights command generates a 30-day HTML report summarizing your Claude Code usage. It includes session counts, token consumption input and output , task category distribution, repeated patterns across sessions, session efficiency metrics, and data on abandoned or multi-round sessions. The report is generated from locally stored usage logs and opens in your browser. How often should I run /insights? Seven tools to build an app. Or just Remy. Editor, preview, AI agents, deploy — all in one tab. Nothing to install. Running it once a month is a reasonable cadence for most developers. The report covers a rolling 30-day window, so monthly reviews give you a fresh, non-overlapping picture of your usage. If you’ve recently changed your workflow significantly — added CLAUDE.md instructions, created custom commands, or shifted project focus — running it two to three weeks after the change helps you measure whether things improved. Does /insights share my data with Anthropic? No. The report is generated from session logs stored locally on your machine. The command processes that local data to produce the HTML report without transmitting session content or usage data to external servers. Your prompt history and code context stay on your device. Why is my token usage so high? High input token counts usually mean you’re including more context than Claude Code needs — full files when only a function is relevant, long error logs when only the key lines matter. High output token counts often indicate you’re regenerating large blocks of code that could be templated or cached. The task category and repeated patterns sections of the report usually point to where the excess is coming from. Can I use /insights in a team setting? The command reflects individual usage since the logs are stored per machine. There’s no built-in team aggregation. If your team wants shared visibility into collective Claude Code usage patterns, you’d need to share HTML report files manually or build a lightweight aggregation process around the local log data. Each developer runs their own report and compares findings. What’s the difference between /insights and just reviewing my Claude Code history? Your session history shows you what you did. The /insights report shows you patterns across what you did — which is a different kind of signal. Reading individual sessions tells you about specific decisions. The report tells you about systematic habits, cost concentrations, and efficiency trends that aren’t visible when you’re looking at sessions one at a time. The aggregated view is what makes it useful for workflow improvement. Key Takeaways - The /insights command generates a local 30-day HTML report on your Claude Code usage — run it from any active Claude Code session with /insights . - The report surfaces token consumption, task category distribution, repeated patterns, and session efficiency metrics. - The most actionable signals are: outlier sessions by token cost, high-frequency task patterns, and low first-attempt success rates. - Act on the report by updating your CLAUDE.md, building custom slash commands for recurring tasks, and offloading structured, repeatable work to dedicated automation tools. - MindStudio is a practical complement to Claude Code — use it to build automated workflows for the routine tasks that /insights identifies, freeing Claude Code for the work that requires active reasoning. The /insights audit only takes a few minutes to run. What you do with the output is where the real productivity gains are.