C
Claude Code ships a "/insights" command that generates a usage report. It covers which sessions succeeded, where things broke, tool usage patterns, cost distribution. It is a HTML file and extracting anything useful from it is just enough friction to lose the habit.
The big issue
There's a bigger problem though. By default, "/insights" generates a report from the past 30 days. That's a huge window. I don't want feedback once per month, I want it once per week. At that point most of the recommendations there are for things you may have solved two or three weeks ago. The report feels stale before you even open it.
I found a solution by manipulating the source data. Claude Code reads "~/.claude/projects/*/*.jsonl" to compute the report. The skill temporarily moves JSONL files older than 7 days out of that directory before running "/insights", then restores them immediately after regardless of success or failure. This constrains the report to the past week only. The archived files are never touched – they just step out of the way for a few seconds. You get fresh data every Saturday instead of a rolling month of noise.
So I built "/insights-actionable" to automate all of that and more.
Cleaning up the report
The raw HTML is noisy. It's generated for a browser: repeated headers, styled dividers, sections that echo each other, recommendation blocks that show up in two different places. Also HTML file is not really usable in Obsidian, so I am creating MD document instead. The difference is striking. From 66 kB as HTML to 25 kB as Markdown – a 61% reduction. Part of that is just stripping tags and inline styles. But roughly 30% of the actual content goes too: duplicated recommendation blocks, repeated framing, useless sections...
Installing and scheduling it
You can install the skill and set up the weekly schedule in one prompt. Paste this into Claude Code in your brain root:
Install the insights-actionable skill from github.com/jkvetina/AI_SKILLS. Then set up a launchd agent at ~/Library/LaunchAgents/com.brain.insights-actionable.plist that runs /insights-actionable every Saturday at 20:00 local time, using `claude -p "/insights-actionable" --permission-mode bypassPermissions` inside this directory. Load the plist and verify the agent is registered.
Run it manually once first to confirm the report generates and the Markdown lands where you expect. Then let the Saturday schedule take over. The skill is published on my GitHub.
Let me know how it went and if you find it useful, share it with a friend.
Comments
Post a Comment