Three weeks after I said CLAUDE.md writes itself, it added 4 more rules without me Three weeks after publishing an article claiming that his CLAUDE.md file "writes itself," the author found that the file had autonomously added four new rules between April 28th and May 21st, 2026. These rules were generated organically from real incidents and technical audits during his solo development work, including a cache authentication contract rule from a security audit, a database constraint rule from a data import bug, and a contract immutability rule from a professional training requirement. The author emphasizes that he did not sit down to write these rules intentionally but simply recorded them as they emerged from production issues and code reviews. A thesis, three weeks later On April 28th, I published an article on DEV.to that made four claims about a CLAUDE.md file — the one that constrains the coding agent at each session — and ended with this sentence: "the CLAUDE.md is never finished, and that's precisely why it works" 4 incidents, 4 rules: how my CLAUDE.md wrote itself https://dev.to/michelfaure/4-incidents-4-regles-comment-mon-claudemd-sest-ecrit-tout-seul-dpl . That was a thesis, not a metaphor. Three weeks passed. The file added four rules without me. What I mean is that I didn't write them on a day I sat down to write rules. I received them on the days an incident had produced them, and all I had to do was record them before they evaporated in the flow of the project. The difference, on paper, seems thin. In the practice of a solo dev piloting an agent in production, it's doctrinal. One clarification before the list: this article's title almost said "five rules." live-snapshot-cache.md was committed on April 25th, three days before the pivot article was published. It doesn't count. I'd rather have the honest number than the comfortable rounding. The audit, measured by git No narrative without raw material. Here is what git log --diff-filter=A --follow on .claude/rules/ returns between April 28th 2026 publication of the pivot article and May 21st 2026 today — four new files strictly post-publication. cache-auth-contract.md — committed May 2nd. Born from a technical debt audit, not a production crash. It's a Friday late afternoon. Niran is settled two desks away, headphones on, a closed burger box in the corner. I'm going through docs/dette/AUDIT-2026-04-30.md section D-20 on the right screen, code on the left. Reading through getCachedFormateurs , I understand that the unstable cache is shared across all users — session not propagable. If someone exposes this function via an API route without a guard, it's a silent RBAC leak. I look up to talk to Niran about it. He removes his headphones, listens, says "Yeah, that bites." He puts them back on. The rule gets written that evening. // .claude/rules/cache-auth-contract.md — anti-pattern to prohibit // Flaw: no guard export async function GET { const formateurs = await getCachedFormateurs return Response.json formateurs } // Correct export async function GET req: NextRequest { const supabase = await createSupabaseServer const { data: { user } } = await supabase.auth.getUser if user return new Response 'Unauthorized', { status: 401 } const profile = await getUserProfile user if canAccess profile, 'communication' return new Response 'Forbidden', { status: 403 } const formateurs = await getCachedFormateurs return Response.json formateurs } inscrit-nom-prenom-required.md — committed May 14th. "Hm, it's buggy." — Catherine, two hours earlier. "But it's a quick fix." The daily drift probe sonde contacts orphelins inscrits surfaced an inscrit -status contact with an empty first name — a child named Loubna, imported from Airtable where the first name lived in a separate unmapped column. The grep that followed found sixteen similar cases. What would have broken regular attendance tracking Cannot read properties of undefined gets caught by a Postgres CHECK constraint that closes the incident class at the root. -- .claude/rules/inscrit-nom-prenom-required.md CHECK statut < 'inscrit' OR nom IS NOT NULL AND nom < '' AND prenom IS NOT NULL AND prenom < '' Without this CHECK, the rule stays textual in CLAUDE.md and the next import brings back a seventeenth case before the next probe. With it, the INSERT fails, and the import surfaces the problem at the source. contrat-formation.md — committed May 16th, in the wake of ADR-0068. It's the longest rule, because the professional training contract is a Snapshot where every column carries its guarantee of immutability. motivation code , text version , cases cochees , pdf storage path — frozen at generation, never recalculated retroactively. An evolution of the contract is never a rewrite of the Snapshot, it's a new event with a new text version . The rule exists because the three-year Qualiopi audit rests entirely on the immutability of the generated PDF and the associated trainee signature — a retroactive recalculation would be enough to make the file indefensible. hybrid-snapshot-live-reset.md — committed May 19th, two days before this article. Before sending the fifty-three Phase 2 re-enrollment SMS messages, a pre-flight audit surfaced that one token out of the fifty-three was consumed — created in test mode that morning, clicked, used at non-null. If the Phase 2 SMS went out as-is, the link /r/