Original Reddit post

This is a heavier version of the MISTAKES.md setup posted here recently. When Claude hits a bug in my projects, the fix starts with an md file. It has to file a fix record before it’s allowed to touch anything - one markdown file per mistake. I set all of this up purely for discipline, I wanted less (ideally zero) confidently wrong fixes. I didn’t expect the folder to turn into anything. But every recurring mistake in the project ended up in there, root-caused and dated, in the same format every time. My current project has 49 of these case files. My favorite opens with “The agents look like bullet points” - a deleted wrapper had orphaned five CSS variables and 23 cards were quietly rendering as plain text, zero build errors. The Pre-Fix Gate The fix record’s sections are the whole trick: Symptom: what was actually observed, specifically. Investigation: what it actually checked, not what it assumed. Root cause: has to name a mechanism. “The nested skill call never returns control to the caller, so the flow silently stops halfway” counts. “The workflow is flaky” doesn’t get written. Planned change: what to edit and why that resolves the root cause. And there’s one more gate before claude can touch code: it answers in writing whether it’s 100% certain the change resolves the root cause. A hedge means no edit, the problem gets promoted to properly planned work instead. The Mining Pass Once 10 new fixes pile up, an agent reads the WHOLE folder with one job: find records pointing at the same cause and reject everything else. It rejects most of them, 59% got thrown out as one-offs on the first run. Whatever survives comes back as proposed rules, each one citing the case files that back it. I approve or kill each one by hand. Graduation into .claude/rules/ Approved rules land as files in .claude/rules/ and load into every session after. That skill-nesting root cause up top showed up in more than one case file. The mining pass caught it and proposed: Never nest skill invocations more than one level deep. I approved it, never wrote a word of it. It’s been law in every session since, and that class of bug stopped happening. How to Rig This Today You can do a rough version of this yourself: A folder That fix record template A recurring prompt that mines the folder every N fixes The enforcement half is the part I had to build tooling for - an agent that literally can’t edit until the record passes the certainty check. I packaged mine into my plugin Craft , but the pattern is the part worth stealing. So now every rule in .claude/rules/ came out of claude’s own case files. I never spotted a single pattern myself. Tell me what you think. TL;DR: Claude files a fix record before every fix. At 10 records, an agent mines the folder for repeated root causes, survivors become rules that load every session, and mistakes stop repeating without me spotting a single pattern. submitted by /u/SnooComics4579

Originally posted by u/SnooComics4579 on r/ClaudeCode