Menu

Post image 1
Post image 2
1 / 2
0

How to Write a CLAUDE.md Rule That Actually Gets Enforced

DEV Community·Brad Kinnard·23 days ago
#t5csw2Sm
#ai#programming#rules#rule#code#types
Reading 0:00
15s threshold

Open a CLAUDE.md file at random and you'll find build commands, architecture notes, and rules. The rules tend to be the unenforceable kind. "Write clean code." "Be careful with types." "Follow our conventions." The author meant every word. The agent reads them. And nothing checks whether the agent followed them, because nothing can. In a corpus of 580 CLAUDE.md, AGENTS.md, and .cursorrules files from public GitHub repos with 10+ stars, 74% contained zero machine-extractable rules . Not because the authors didn't care about rules. Because most rules were written in a form no parser could pull out as a deterministic check. This post is about the difference. Specifically: how to phrase a rule so a parser can extract it and a verifier can check it, without sacrificing what you actually meant. The principle Enforceability comes from a verifiable surface. A rule is verifiable when there's a concrete pattern in code that either matches it or doesn't.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More