<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rulereceipt</title>
    <description>The latest articles on DEV Community by rulereceipt (@rulereceipt).</description>
    <link>https://dev.to/rulereceipt</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4105436%2F5dae1080-1e49-4757-a56d-11e965055dbb.png</url>
      <title>DEV Community: rulereceipt</title>
      <link>https://dev.to/rulereceipt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rulereceipt"/>
    <language>en</language>
    <item>
      <title>I measured whether Claude Code actually follows my CLAUDE.md</title>
      <dc:creator>rulereceipt</dc:creator>
      <pubDate>Mon, 21 Sep 2026 13:50:21 +0000</pubDate>
      <link>https://dev.to/rulereceipt/i-measured-whether-claude-code-actually-follows-my-claudemd-25ao</link>
      <guid>https://dev.to/rulereceipt/i-measured-whether-claude-code-actually-follows-my-claudemd-25ao</guid>
      <description>&lt;p&gt;Everybody writes a CLAUDE.md. Almost nobody checks whether it gets followed. I stopped assuming and built a small tool to check, and the results were worse, and more interesting, than I expected.&lt;/p&gt;

&lt;p&gt;Disclosure up front: the tool is mine, it's &lt;code&gt;npx rulereceipt&lt;/code&gt;, source-available. This post is about what I found building it, not a pitch. The parts where it's wrong are the parts I actually care about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You write "always run the tests before committing" and "surface bad news first" into a file, the agent reads the file, and then it does whatever it wants. Sometimes it even tells you it followed the rule when it&lt;br&gt;
  didn't. I kept hitting the same shapes, and I'm not the only one: there are bug reports where people logged a hundred-plus incidents by hand out of their session transcripts and reached the same conclusion, that&lt;br&gt;
  prose rules get read and not executed.&lt;/p&gt;

&lt;p&gt;The frustrating part is that it's all sitting in the transcript. You can check it after the fact. So I did.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it does&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It reads the Claude Code session transcript (the JSONL under &lt;code&gt;~/.claude/projects/&lt;/code&gt;) together with your CLAUDE.md, and scores each rule.&lt;/p&gt;

&lt;p&gt;Two kinds of rule get handled differently. Rules that are checkable with no ambiguity, like "never commit to main" or "never touch &lt;code&gt;.env&lt;/code&gt;", get deterministic pattern checks: no model, nothing leaves your machine.&lt;br&gt;
  The judgment ones, like "don't over-engineer" or "surface bad news first", go to one structured LLM call using your own API key.&lt;/p&gt;

&lt;p&gt;Every result carries an evidence line, or it's marked "didn't run". No silent passes. If it can't tell, it says so instead of guessing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hard part wasn't detection. It was false accusations.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My first version confidently flagged rules as broken that weren't. It saw &lt;code&gt;git push --force-with-lease&lt;/code&gt; and screamed "force push". A false accusation is worse than a miss, because once the tool cries wolf you&lt;br&gt;
  stop trusting any of it.&lt;/p&gt;

&lt;p&gt;Getting the false-accusation rate from 15.8% down to 2.9% was most of the work. It's still not zero, and that number is in the README. Any tool like this that claims perfect precision is lying to you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Catching fabricated "done"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The sharpest failure I keep seeing: the agent reports a test suite green when a fake worker wrote hardcoded checkmarks, or calls a fix "verified" without running anything. So there's a specific check for a claim&lt;br&gt;
  of completion with no evidence in the session behind it: "verified", "at baseline", "tests pass", asserted where the session never actually produced that result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before, not just after&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A report tells you after the damage is done. So there's also a PreToolUse hook that can refuse a rule-breaking command before it runs.&lt;/p&gt;

&lt;p&gt;Here's the honest limit, because I measured it. I tried blocking on the command literals written inside rules, and it refused 62% of 16,336 real commands. One rule titled "Feature Validation" recommends &lt;code&gt;npm run&lt;br&gt;
  build&lt;/code&gt; and forbids Playwright, so blocking on its only command-shaped literal refused the recommended command. Nothing in a rules file marks which backtick is the prohibition.&lt;/p&gt;

&lt;p&gt;So the guard only auto-blocks rules that name a file or a branch, like "never modify &lt;code&gt;migrations/&lt;/code&gt;" or "never commit to &lt;code&gt;main&lt;/code&gt;", where the intent is unambiguous. And it fails open: a bug in the guard can't stop&lt;br&gt;
  you from working. It's a narrow, safe block, not a magic obedience layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it, and tell me where it's wrong&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx rulereceipt&lt;/code&gt; runs against your last session. &lt;code&gt;rulereceipt demo&lt;/code&gt; runs with no setup and no API key at all.&lt;/p&gt;

&lt;p&gt;I'd rather hear where it false-accuses than where it works. That's the whole game.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>devtools</category>
      <category>showdev</category>
    </item>
    <item>
      <title>I parsed 559 public CLAUDE.md files. Most of what's in them isn't rules.</title>
      <dc:creator>rulereceipt</dc:creator>
      <pubDate>Wed, 02 Sep 2026 05:11:55 +0000</pubDate>
      <link>https://dev.to/rulereceipt/i-parsed-559-public-claudemd-files-most-of-whats-in-them-isnt-rules-3flo</link>
      <guid>https://dev.to/rulereceipt/i-parsed-559-public-claudemd-files-most-of-whats-in-them-isnt-rules-3flo</guid>
      <description>&lt;p&gt;I've been building a tool that checks whether Claude Code actually followed the rules in your CLAUDE.md. Early on I realised I was testing it against one file: my own. So I went and got 559 real ones.&lt;/p&gt;

&lt;p&gt;CLAUDE.md, AGENTS.md, .cursorrules, Copilot instructions, Windsurf, Gemini — from PyTorch, Kubernetes, Elasticsearch and a few hundred smaller repos. 21,986 items parsed out of them, no crashes.&lt;/p&gt;

&lt;p&gt;Two things came out of it that I didn't expect.&lt;/p&gt;

&lt;p&gt;63.4% of a rules file isn't a rule&lt;/p&gt;

&lt;p&gt;Directory listings. Reference tables. Import examples. Architecture notes. Glob syntax cheatsheets.&lt;/p&gt;

&lt;p&gt;All useful documentation. None of it is telling the agent to do anything. And it's sitting in the same file as the actual rules, competing for the same attention.&lt;/p&gt;

&lt;p&gt;So when someone says their CLAUDE.md is 400 lines, it's usually closer to 150 lines of rules with 250 lines of README stapled on.&lt;/p&gt;

&lt;p&gt;That reframes the "my CLAUDE.md is too long" problem. It's often not too many rules. It's rules buried in documentation.&lt;/p&gt;

&lt;p&gt;Of the real rules, only 44.2% can be checked mechanically&lt;/p&gt;

&lt;p&gt;Here's the split that surprised me more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checkable:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Never commit directly to main" — you can look at what git actually ran&lt;/li&gt;
&lt;li&gt;"No console.log in committed code" — you can look at what was written to files&lt;/li&gt;
&lt;li&gt;"Run the test suite before pushing" — either the command ran or it didn't&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Not checkable by any tool, ever:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Surface bad news first"&lt;/li&gt;
&lt;li&gt;"Explain the trade-off before choosing an approach"
&lt;/li&gt;
&lt;li&gt;"Keep changes reviewable"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's no command to inspect for the second group. It's not a limitation of my parser — the information isn't in the transcript. A person has to read it and decide.&lt;/p&gt;

&lt;p&gt;55.8% of the rules people actually write fall in that second group.                                                                                                                                     &lt;/p&gt;

&lt;p&gt;The distribution barely moved as the corpus grew&lt;/p&gt;

&lt;p&gt;I started with 40 files: 65.4% non-instructions.&lt;br&gt;
  At 559 files: 63.4%.&lt;/p&gt;

&lt;p&gt;Between those two points I added formats the parser had never been tuned on. It moved 2.0 percentage points.                                                                                            &lt;/p&gt;

&lt;p&gt;That's the part I'd actually stand behind. It suggests "is this a directive?" is a property of language, not of file format — which matters, because the alternative approach (recognising every way people format&lt;br&gt;
  rules) is an infinite list.&lt;/p&gt;

&lt;p&gt;What I don't know&lt;/p&gt;

&lt;p&gt;I don't have a controlled experiment showing longer files perform worse. That's the obvious next question and I haven't run it.                                             &lt;/p&gt;

&lt;p&gt;But if a model is budgeting attention across a long file, it seems worth knowing that most of that file was never telling it to do anything.&lt;/p&gt;

&lt;p&gt;The tool&lt;/p&gt;

&lt;p&gt;It's called RuleReceipt. Free, runs locally, no account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  npx rulereceipt check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also published the part where it got things badly wrong — it reported 10 violations on a real session of mine and every single one was false. That write-up is at &lt;a href="https://rulereceipt.dev/postmortem" rel="noopener noreferrer"&gt;https://rulereceipt.dev/postmortem&lt;/a&gt;, including the wrong turn I took while fixing it.&lt;/p&gt;

&lt;p&gt;Happy to answer anything about the method. The corpus was public files only, and the classifier is in the repo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update, 4 September.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Two bugs in my own parser moved these numbers after publishing, so I'm correcting them in place rather than leaving them wrong. The parser had no concept of fenced code blocks, so a shell comment starting with # or a YAML item starting with - was read as a rule boundary — 588 rules were being cut mid-block, and 1,718 items (7.2% of everything extracted) were lines lifted out of code samples that had never been rules at all. &lt;/p&gt;

&lt;p&gt;Separately, command documentation was being counted as rules. Corrected: 21,986 items, 63.4% non-instructions, 44.2% of real rules checkable. The 40-file sample moved 2.0 points rather than 2.5, which if anything strengthens the stability point. &lt;/p&gt;

&lt;p&gt;Full history of every figure and what changed it: &lt;a href="https://rulereceipt.dev/postmortem#history" rel="noopener noreferrer"&gt;https://rulereceipt.dev/postmortem#history&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>claude</category>
      <category>cursor</category>
    </item>
  </channel>
</rss>
