Writing a CLAUDE.md that Claude actually follows
The author describes their initial CLAUDE.md file with 30 lines of instructions such as "write clean, readable code," "keep functions small and focused," and "be concise in explanations." Despite Claude acknowledging the file each session, it would produce 400-line explanations and functions that did four things with three layers of abstraction. The author realized the problem was that instructions like "be concise" are not actionable—they are aspirations that do not constrain LLM behavior. An LLM follows vague advice by interpreting it in a way consistent with what it was already going to do. The post contrasts this with specific, verifiable, and binary instructions that actually stick. The author provides examples of effective instructions, such as limiting function length to a specific number of lines or requiring explicit error handling patterns. The key insight is that instructions must be enforceable, like those a reviewer would give a junior engineer, rather than stylistic preferences.
Developers must write specific, verifiable instructions in CLAUDE.md to actually constrain LLM behavior.