DEV Community

Cover image for The best CLAUDE.md rules are hiding in your chat history.
Manpreet Singh
Manpreet Singh

Posted on Edited on Originally published at singhlabs.dev AI-assisted

The best CLAUDE.md rules are hiding in your chat history.

Corrected 9 Oct: the toldya I first used had three bugs. It counted a message again every time a resumed session copied it (fixed in 0.3.3), it could split one habit in two depending on the order it read the files (0.3.4), and it counted "I don't get it" as a rule, when that's just me lost (0.3.5). Counted properly, "keep it simple" was 18 by 25 Sep, not 42. Every toldya number below is a re-run with 0.3.5 on 9 Oct. Still 18.

Quick question. What's the one sentence you've typed to your AI more than any other?

Not the one you think you type. The one you actually type.

I didn't know mine either. So I went back through three months of my own Claude Code history and counted. It was "keep it simple." 18 times, across 17 different sessions. And that rule was written nowhere my AI could read it.

Every correction you type and don't write down dies with the session.

If you use Claude Code, Cursor or Codex every day, you have your own "keep it simple." This post is about finding it, writing it down, and checking whether it stuck. At the end there's a one-minute way to see your own top line.

The 18 times

This is a real run on my real history, 175 Claude Code sessions between July and October:

$ npx toldya --all --min 4 --dry

toldya · 175 sessions (2 Jul – 9 Oct) · 3817 of your messages · 323 corrections

You keep telling your AI:
   1.  18×  keep it simple   (17 sessions)
   2.  12×  Don't complicate it   (7 sessions)
   3.   5×  dont ask me   (4 sessions)
   4.   4×  dont assume   (4 sessions)

And 42 times you told it to try or check again: its first go missed.
Enter fullscreen mode Exit fullscreen mode

Numbers one and two are the same complaint. Two is every way I've typed "don't complicate", typos and all, counted as one habit. Together that's 30 times I asked my AI for simpler. The last line, 42, is "try again" and "check again", which isn't a rule, just an honest measure of how often the first attempt missed.

This isn't a complaint about Claude. It's genuinely good at what I use it for. It's that every one of those corrections was a rule I never wrote down.

Why your AI forgets everything

A coding agent doesn't remember yesterday. Each session starts from zero. What you corrected on Tuesday afternoon is gone by Wednesday morning.

The one thing it reliably reads at the start of every session is a small text file in your project called CLAUDE.md. Other tools use AGENTS.md, same idea.

Think of it as a sticky note on the monitor for a brilliant new colleague with amnesia. They wake up every day with no memory of you. The note is the only thing that carries over. If it's not on the note, it's gone.

What to put in CLAUDE.md? What you keep repeating

Every CLAUDE.md guide gives the same advice: when your AI repeats a mistake, add a rule for it. It's good advice. I agree with it.

The gap is that you don't notice you're repeating yourself. My "keep it simple" came up in 17 sessions, across different projects, weeks apart. Each time it felt like a one-off. I never once thought "this is the fifteenth time." Repetition across days is invisible from inside the day.

That's why none of my top four were in my CLAUDE.md. Not laziness. I just had no idea.

Why grep lies to you

Claude Code keeps your history on your own machine, as text files in ~/.claude/projects. So the obvious move is to search it. I searched for "keep it simple." It said 747. The real number was 18.

Bar chart: a plain search of the history counts 747 matches for keep it simple; counting only what I actually typed gives 18
Same phrase, over 40 times too big. The grep is from 25 Sep, the count from 9 Oct.

The files hold everything, not just what you typed: the AI repeating your words back, summaries written when a chat gets long, tool output, logs and briefs you pasted. Counting properly means keeping only the short messages you typed, dropping questions and pastes, and grouping the ways you say the same thing. "Don't complicate it", "dont complex this" and "dont comlicate that" are one habit, not three.

So I built a tiny thing

It's called toldya, as in "I told you so." A free command-line tool that does the counting above, then offers to write the results onto the sticky note for you. One command, Node 18 or newer, no account:

npx toldya --all
Enter fullscreen mode Exit fullscreen mode

It reads your Claude Code history on your machine, shows the list above, and asks about each one: y adds it as a rule, n skips it, e lets you reword it first. Nothing is written without a yes. Or pick by number:

npx toldya --all --min 4 --add 1,2,4 --to CLAUDE.md
Enter fullscreen mode Exit fullscreen mode
Added 3 rules to CLAUDE.md. Run toldya again in a week to see if they stuck.
Enter fullscreen mode Exit fullscreen mode
## Things I kept repeating
- Keep it simple.
- Don't complicate it.
- Dont assume.
Enter fullscreen mode Exit fullscreen mode

Yes, it keeps my typo. They're your words. Fix them with e.

Did it stick?

Adding a rule doesn't mean the AI follows it. The file can be read perfectly and the rule can still not land.

So toldya remembers which rules it added, and when. Run it again a week later and each rule shows how often you said it before it went in, and how often since. If "keep it simple" drops from 18 to near zero, the rule works. If it keeps climbing, the wording isn't landing.

I can't show you a "since" number yet. The tool is a few days old, so there is no "since" to count. That's the honest state of it.

And because it made me laugh: npx toldya --all --card draws your top repeats as a picture, on your machine, with a "Save as PNG" button. Nothing is uploaded.

toldya card: I have told my AI keep it simple 18 times. Also Don't complicate it 12, dont ask me 5, dont assume 4, next to the green character at a tally-mark wall
Mine, redrawn after the recount.

The part I got wrong

I had a bigger idea first: a team version that reads a project's pull-request review comments, finds what reviewers keep writing, and turns that into rules.

Before building it, I pulled the last 1,000 review comments from each of Next.js, React, Astro, Supabase and Cal.com, and ran the same counting on them. Almost nothing repeated as a rule. The top "repeats" were "This is changed now" (13 times), "Fixed in the latest commit" (9) and "Thanks for the test" (7). That's conversation. Reviewers write about the code in front of them.

People correcting their own AI are the opposite: the same handful of sentences, in the same words, for months. So the team version got dropped.

What it doesn't do

  • Claude Code only, for now. Codex stores history elsewhere and I haven't tested it on real files, so I'm not claiming it.

  • It matches words, not meaning. It won't connect "use the logger" with "why is there a console.log here?". That would need a model, and I wanted it small, free and local.

  • It sees only the history you have. Claude Code keeps about 30 days by default.

  • It needs a pattern. A phrase must appear three times, in two different sessions. New to Claude Code? You may get "nothing repeated yet." Good result.

  • It sends nothing anywhere. Only your own messages are read. No account, no telemetry, no network calls.

Try it in a minute

The safe version only shows the report and changes nothing:

npx toldya --all --dry
Enter fullscreen mode Exit fullscreen mode

The code is at github.com/singhlabsdev/toldya, MIT, zero dependencies. If it finds something useful, a star helps other people find it. And I'd genuinely like to know your top line. Mine is "keep it simple." 18 times.


Sources: every terminal block is a real toldya 0.3.5 run on my own Claude Code history on 9 Oct 2026, the --add run cut to its result. The 747 is a plain grep of the history on 25 Sep 2026. The review-comment figures come from the last 1,000 comments per repo, fetched from the GitHub API on 25 Sep.

Where this fits: memory and context, layer 2 of the Agent Ops Stack.

Read next: I researched loop engineering to build a product. I built nothing. · My mailer printed “campaign sent”. It had sent to nobody.


Originally published at singhlabs.dev.

Top comments (1)

Collapse
 
nark3d profile image
Adam Lewis •

Almost everyone I know types some version of "that's not what I asked". It never makes it into the file because it feels like a correction rather than a rule. Writers miss that the good rules arrive as failures. The useful move is writing down what the model got wrong and what you wanted instead, in the same breath, before you fix it. A rule you extracted from a chat you've already forgotten reads like policy, and policy is the thing nobody follows.