I use Claude Code across 39 projects and folders. That’s this site, my own products (Stack Almanac, an AI supplement advisor, Reweave, a psychedelic integration platform, and Lion Heart, a relationships app that’s still in stealth), the AI Role Factory, client work, and the tooling that holds it all together. Between May and November that came to 687 sessions, counting the scheduled runs, and about 6,000 messages I typed myself.
About 200 of those messages were some version of “merge it”. I’d written a rule about that too. If your team has written instructions for ChatGPT projects, a custom GPT or Copilot, you’ll have the same problem. Rules get written in whichever project the incident happened in, one incident at a time, and nobody goes back to ask which ones are still doing anything.
What I read, and how
Claude Code keeps every session as a file on your own machine, under ~/.claude/projects. It deletes them after 30 days by default, and I’d raised that setting months ago, which is the only reason there was half a year to read. I had a script pull out only the messages I’d typed, and drop everything else: tool output, the text Claude Code adds itself, and the scheduled runs. Then 5 agents each read a slice and looked for 4 things: corrections I’d given more than once, jobs I keep typing out by hand, context I keep pasting in, and where the hours go.
In August I suggested deleting your instruction file every 6 months, then writing down every mistake the agent makes for a week. Your session history is that list, already written.
The rules existed. They weren’t working.
I expected a list of missing rules. What came back was mostly rules I already had.
- The agent stopping early. I nudged it about 250 times. In 38 of them, it had just said it would finish once the automated checks passed, then stopped without waiting for them.
- Drafts that sounded like AI. I corrected this at least 17 times. My notes said “Nick should never have to ask whether I checked the voice file”, and I asked 5 more times after that line was written. On one of those, the draft used a sentence my voice file bans by name.
- “Done” when it wasn’t. I asked some version of “I don’t see it” or “is this saved?” about 25 times. The agent said finished while the work was only on my laptop, not saved to the shared copy.
- Internal codes and jargon in replies. I had to ask what something meant about 20 times, because it showed me a record id or a label I’d never seen.
Every one of these had a rule. The rules failed in one of 2 ways. Some sat in the notes Claude keeps for one project, so sessions in the other 38 never loaded them. The rest were prose: a plain sentence in an instruction file, like “never use em dashes”. The agent reads it, and nothing happens when it’s ignored.
Anthropic’s own guidance says as much: the instruction file (CLAUDE.md) is guidance, and only a script that runs every time is guaranteed. What I hadn’t done was count what ignoring that had cost me. My voice rule had both problems at once.
Writing the rule down again wouldn’t have fixed any of these. The fixes were moving each rule to where it loads, and putting a check behind it.
Fixing it: where rules load, and what checks them
So the rules I want in every project moved into the one instruction file every project reads. Then the 2 that kept breaking got checks, using hooks, which are small scripts Claude Code runs at set points in a session.
The voice rule became a hook that runs whenever the agent writes a draft or a blog post. A script checks the text against my writing rules, and any banned word, dash or semicolon goes back to the agent to fix before I see it. It caught a banned word in the first draft of this post. “Done” became a second hook: if the reply says done, shipped or merged while work is still only on my laptop, the agent has to finish the job or say plainly what isn’t saved.
The second hook taught me something inside a week. It fired in 62 sessions, and in one of them it raised the same leftover folder about 14 times. A check that nags about something nobody’s going to change gets ignored just like prose does, so now it flags each problem once per session and stays quiet until something new appears.
The other direction: too many rules
Reading the history also pointed the other way. Before I typed a word, every session on this site was loading about 3,000 words of project instructions, notes on 74 topics and the global file on top. Almost every rule came from a real incident, so none of them looked wrong on its own. The agent’s own read, when I asked, was that the total made it more cautious: it asked permission more than the risk needed and added ceremony.
So I pruned. The project instructions went from about 3,000 words to about 1,000, and the notes from 74 topics to 47, mostly by moving client notes into the projects they’re about. Two things from that pass stood out. A bold warning that removing 2 lines of page code would break Google’s AI Overview snippets had no test behind it at all, so it’s a test on every page now and the warning is gone. And a skill-routing hook from a toolkit I use had fired 447 times in just over a week, 98% of the time towards the same 3 skills, mostly on text I hadn’t typed. I only found that because I measured it. It’s off now.
The test I use now
For every rule, I now ask what happens if a session ignores it.
- A test, lint rule or hook already fails, with a message saying what to do. Delete the sentence. The failing check teaches the rule at the moment someone breaks it.
- Breaking it changes something a machine could see, but nothing fails today. Write the check, prove it fails when you break the rule on purpose, then delete the sentence.
- Only one kind of job needs it. Move it into a Skill, a set of instructions that loads only when that job comes up.
- Nothing can catch it. Keep it, in a sentence or two. These are the mistakes that fail without anything noticing, like a command that posts under my name and works perfectly.
And a rule I want everywhere goes in the global file, not in whichever project I happened to be in when it bit me. A rule protects you only if it loads where the work happens and something fails when it’s broken.
Here’s that sort as a prompt you can run on a project’s instruction file. It ends in checks rather than a longer file.
Prune this repo's CLAUDE.md (and AGENTS.md if there is one) so every session carries only what it needs.
First run git fetch and work from the default branch, so you're not judging a stale copy. Grep the tests, scripts and CI for anything that reads CLAUDE.md, so you don't break them by accident.
Then, for every rule, ask what happens if a session ignores it, and sort it:
1. A test, lint rule or hook already fails with a clear message: delete the prose.
2. Breaking it changes something a machine could see, but nothing fails today: write the check, prove it fails when you break the rule on purpose, then delete the prose.
3. Only one kind of job needs it: move it into a Skill that loads for that job, and leave behind only a guardrail that must hold even if the Skill never loads.
4. Nothing can catch it (a judgement call, or a command that works perfectly and does the wrong thing): keep it, in one or two sentences.
Also delete anything that repeats my global CLAUDE.md, any incident history (that belongs in a test comment or a commit), and any list the agent can discover for itself.
Show me before and after sizes, each new check and how you proved it fails, and what moved into Skills. Ask me only about conflicts between rules.
What else the history showed
The jobs I type out by hand were a list of Skills I hadn’t built yet. The biggest was turning a meeting into actions, a brief and a follow-up, which I’d asked for about 56 times. I had a runbook for it, but its description only mentioned “digest”, and I sometimes say “ingest”.
The context I paste was a list of facts with no home. I’d pasted about 75 meeting transcripts into one client engagement, sometimes the same one twice, and typed the same standing facts about that engagement again and again, like which days I work for them. If something goes in twice, it belongs in a file the agent reads.
And a quarter of the agent hours went on keeping the system itself running, mostly releasing and merging work. I’m fixing that next.
Run it on your own history
Here’s the review prompt, cut down so it works on anyone’s setup. Run it in Claude Code on the machine where your sessions live. It only reads, and it asks before it changes anything.
Read my Claude Code session history in ~/.claude/projects. Use the top-level .jsonl files only, and skip the subagents folders. Write a small script that keeps only the messages I typed, dropping tool results, injected skill text, system reminders and scheduled-task runs. If there are more than a few hundred sessions, split the reading across subagents, one question each.
Then find, with counts, dates and 2-3 short quotes each:
1. Corrections I gave more than once (the same complaint in different sessions).
2. Jobs I type out by hand that should be a Skill.
3. Context I keep pasting in that should live in a file.
4. Where the hours go, by kind of work (cap idle gaps at 10 minutes).
For each repeat correction, check my global CLAUDE.md, each repo's CLAUDE.md and my memory files. Tell me whether a rule already exists, and if it does, why it didn't work: it isn't loaded in the repo where the mistake happened, or nothing fails when it's broken.
Then propose fixes in this order:
- move a rule to where it loads.
- turn a rule into a test, lint rule or hook, and prove it fails when broken.
- delete prose that a check already enforces.
- move one-job procedures into Skills.
Also flag any passwords, keys or tokens you see in the history, by file, without printing them.
Don't change anything until I've seen the list.
The transcripts hold everything you’ve ever pasted, so keep this on your own machine rather than uploading the files anywhere. And treat the counts as rough: they come from keyword matching plus reading, so they’re good for ranking problems, not for a report.
If you’d like this run properly on your team’s setup, with the checks built rather than just listed, that’s part of an AI Brain engagement. If you’d rather talk it through first, book a call.
Frequently asked questions
What is a prose rule in CLAUDE.md?
A rule written as a plain sentence in the instruction file, such as 'never use em dashes'. The agent reads it, but nothing happens if it ignores it. A test, lint rule or hook is the alternative: a script catches the mistake and tells the agent what to fix.
Where does Claude Code keep my session history, and for how long?
On your own machine, as one file per session under ~/.claude/projects, in a folder named after the project. By default Claude Code deletes sessions after 30 days, so raise cleanupPeriodDays in your settings.json if you want months of history to review. The files hold everything you ever pasted, so read them locally.
Why does my agent keep ignoring a rule in CLAUDE.md?
In my history there were two reasons. Either the rule was stored somewhere that never loaded in the project where the mistake happened, or it was a plain sentence with nothing that failed when it was broken. Moving it to the global file fixes the first. A test, lint rule or hook fixes the second.
How do I know which CLAUDE.md rules to delete?
Ask what happens if a session ignores the rule. If a check already catches it, the sentence can go. If only one kind of job needs it, move it into a Skill. Keep it as a sentence only when nothing can catch the mistake.
Join the Drift Digest
One short email in any week I publish, with the highlights from each new post, plus new AI tells as models change and a quarterly nudge to re-measure your voice. No spam, unsubscribe anytime.
Something went wrong. Please try again, or email web@ctoondemand.co.uk.
