There is no shortage of agent skills to install, and I have a growing list of ones I'd like to build. But my view is that Claude and other agents work best without loads and loads of skills, so before building anything I wanted evidence of which ones I actually need. Ten months of my coding agent logs seemed like the obvious place to look.
Motivation¶
This was my second attempt. In August I spun up a VM, copied over my log archives and asked an agent to build a pipeline around a list of keywords ("thanks", "why", "revert", "handover", "you were right", etc.), using keyword and fuzzy searches, and calling an LLM whenever it needed a judgement. I asked for a Python pipeline because I anticipated re-running the exercise, but I'm becoming more likely to use agentic workflows instead. The results were noisy: it searched 70k messages including tool output, so matches for "?" and "block" made up 87% of the hits. One project, my Pokémon bot, dominated everything.
That first attempt was still useful: its keyword list, its notes and its mistakes were written down. It was easy to point Claude at it and ask for an updated approach.
The objective this time was a short, ranked list of Skills (and CLAUDE.md refinements), seeded from ideas already on my list: decomposing plans so a /goal loop can run overnight, project-specific rules, memory-throttled test suites, faster feedback loops and spotting sessions that are going off the rails.
How it worked¶
As usual, I pointed the agent to my notes and asked for a plan, then answered a few clarification questions and then left it to work.
The pipeline it built:
- Collect: pull the session files out of archived VMs plus my local harness (Claude Code, OpenCode, etc.) folders/databases.
- Parse: read Claude Code's JSONL transcripts and both of OpenCode's database layouts into one event model.
- Store: load everything into SQLite, with de-duplicated sessions.
- Tag: give each session a project, and separate my sessions from automated/headless runs.
- Measure: compute cheap per-session metrics such as interrupts, tool errors, frustration words and commit reminders, reported per project and per month.
- Judge: call
claude -pwith Sonnet and a fixed JSON schema for anything needing judgement, stratified so that no single project could drive the result.
That left 474 interactive sessions across 18 projects: about 1,175 active hours and 92,602 tool calls. Only 4,666 messages were actually typed by me; the rest of the "user" records were tool output, 5,790 background-monitor notifications, 581 scheduled or looped prompts and command output.
Steering along the way¶
I gave Claude a bit of advice to avoid it fixating, as I know it is prone to do.
- Quality over quantity. I asked for a final prioritisation that favoured a few high-value skills, while going broad in the search, since Claude had read access to my whole knowledge base as well as the logs and might find things I didn't know to ask about.
- Low-level findings stay findings. When the logs showed agents editing files through inline Python instead of the Edit tool, I thought it was too in-the-weeds to drive the skills, but worth keeping in the report. I asked to focus on higher-level workflows unless a low-level issue was causing real problems.
- A hunch about nudges. I use
/goala lot and I'd noticed that when I nudge a long run ("still going?") Claude often replies with something like "oh sorry, I actually missed that the run ended". I asked for this to be dug into, alongside everything else rather than instead of it. - Don't over-anchor on one project. I imagined a lot of the monitoring problems were in the Pokémon bot, but future runs won't necessarily look like that project, so findings had to be framed as general mechanisms and checked for spread across projects.
Borrowing from other people's retros¶
There are already a handful of tools that analyse agent sessions, so Claude read the ones I'd saved and borrowed what fitted:
- review-claudemd finds CLAUDE.md rules that were violated or missing. Its quality gate for any new CLAUDE.md line (is it already covered, does it apply to every session, would a hook do it better, is it short?) was reused to filter my CLAUDE.md suggestions.
- Matt Pocock's retro skill and opencode-session-reflection contributed lenses: information the agent couldn't access, wasteful tool use, stopping early, weak verification and repeated prompts.
- agenttrace covers cost, retry loops and hanging sessions. The gstack retro is git-centric, so less relevant here.
- pstack was checked against each theme to see whether a skill already existed before proposing a new one.
What the logs showed¶
A lot had improved since March, when I wrote that I'd often have to remind the agent to "git commit in logical chunks", and that plan docs went stale. Since then, per 100 typed messages, "please commit" prompts fell from 14-23% to 2-3%, interrupts from 24-28% to about 2% and frustration from 4-8% to 1-3%, while tool calls per typed message more than doubled (from 12-17 to 33-41). In other words, sessions have successfully become more hands-off.
The biggest remaining problem was supervising long runs. Of 103 times I asked about a run the agent was supposed to be watching, it had finished unnoticed 8 times and crashed unnoticed 5 times, but in 47 cases the run was alive but stuck or looping, and the agent hadn't noticed. So my hunch was kind of right: runs did end or stall without the agent noticing. The most common cause was a watcher that didn't detect a stall (35 cases across 3 projects, and in 22 of them I diagnosed it myself during the session - yet this hadn't been codified into a general principle):
Me: surely the tests are not still running??
Agent: You're right - they're not. They finished at 07:42, 20 minutes ago.
timeout 300killed pytest at 98% before it printed a summary line, so my waiter'sgrep -qE "passed|failed|error"never matched and it's been spinning on a file that stopped changing.Me: you should have detected that in your monitor rather than let it loop endlessly...
Agent: I scheduled a 30-min check-in but it never caught this loop, and it spun for ~2h emitting the same line every 3s.
On a game-server bot project, in October I suggested adding stall detection ("if a bot's xp/coords/invent are static for N ticks then the run logs give a warning"). By mid-November the server had a stall detector, but when a run stalled again and I asked "didnt you have a monitor to detect this rather than just sitting and waiting?", the agent replied: "Yes, there was a way to detect it, and I didn't use it. Instead I ran blind sleep 30 loops waiting for the kill count to move". In fact, a good candidate for a standardised check-in routine had come up back in June (I called it "a really good SOP" at the time), but it was written into one project's docs and later projects hit the same failures.
The second deficiency in my coding agent sessions was verification, which is ironic as I'm well-aware of the importance of verification to the emerging software factory paradigm. A lot of my projects share a similar high-level abstraction: an agent building automation that drives a live, stateful system (an emulator, a game server, a Minecraft bot, a TV). The two largest themes in my corrective user prompts were reminding the agent to read the real system state rather than assuming an action worked, and to diagnose from logs and evidence. In many sessions, the biggest time sink was the agent lacking a way to check things itself.
The third area to improve was scoping /goal runs. Across a small sample of 40, well-scoped goals were completed more often than poorly-defined ones, and were less likely to fail the heuristics for qualifying as 'successful hands-off runs'.
What I'm not going to build¶
Some ideas on my list turned out not to need anything:
- Commit reminders and plan pruning: already covered by my CLAUDE.md.
- A tripwire for sessions going off the rails: the agent's activity before a burst of my frustration looked the same as normal activity (same tool volume, error rate and repeated edits), so a cheap hook wouldn't catch it.
- A session-recall skill: I refer back to earlier sessions in only about 2% of messages, and generally an agent can navigate session databases to find what it needs.
- Generalised game-macro abstractions: too specific to one segment of projects, not a general harness improvement.
- A code-review skill: quality catches (reusing existing code, avoiding special-case hacks, etc.) are 4-5% of my messages, falling to 2% in November. I'm not sure what that level of focus says about my code quality, but regardless it's not a top priority for the contexts in which I code.
Other findings¶
- Most file edits no longer go through the Edit tool. Since October about 80% of file edits are made through inline Python in Bash (
s.replace(...)then write the file back), up from 0% before June, with both Sonnet and Opus. 42% don't check that the text matched, so a miss silently leaves the file unchanged. My VM agents almost always run in auto mode, and I didn't ask for this, so I suspect Claude's own defaults. It's also the throwawaypython -chabit I complained about in March (I wanted Claude to capture and re-use scripts rather than iteratively develop complex throwaway commands), which has got worse since. - Learnings get trapped in project repos. Agents had written 14 runbooks and SOPs into individual project repos rather than anywhere shared.
What changed¶
I changed my CLAUDE.md without making it longer:
- (while I don't use
/plan, I still want the agent to) honour "diagnose" or "plan only" until I approve - compare with the last known-good commit before patching a regression
- check the real thing before reporting that something works
I softened a rule that always made the agent stop and ask for clarification, which clashed with running /goal overnight. I also softened a TDD rule, partly because of the increasingly common view that it leads to test bloat, and partly because 135 of my 335 messages about tests were critical, mostly about cost (suites that crashed the session: "WARNING: test suite will crash our session") or unit tests passing while the live behaviour failed ("I just checked. it still doesn't work"). The steer is now to do the cheapest check that proves the behaviour, and prefer no new tests rather than adding bad ones.
And I ended up with a list of AI Skills to build, ranked:
- Supervise long runs: e.g. launch with a time and resource budget, record the PID and confirm the run is alive; watch for completion, failure signatures, process death and stalls, with a scheduled wakeup as a backstop; post short status updates without being asked; and clean up monitors at the end.
- Adopt pstack's
create-verification-skillfor live-system projects, adapted to emphasise speed (seconds, not hours) and checkpoints. - Plan an overnight
/goal: e.g. break the objective into numbered sub-goals, each with its own pass check, plus the conditions for stopping to ask and a time and usage budget.
I'm curious to know, when my AI agent reads this post in a couple of months and re-runs the analysis, what else has changed about my coding workflow and where can we continue to improve it? (I think this is the first time I've deliberately left a message for a future AI agent in one of my posts).