Lv.1 0 XP

Convention Design — Writing Rules Claude Actually Follows

Core 6 min +25 XP
💡
THE ANALOGY

The difference between a vague rule ('write clean code') and a specific one ('functions must have fewer than 20 lines and a single responsibility, with no nested conditionals deeper than 2 levels'). The vague rule is ignored. The specific rule is actionable.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Writing conventions as aspirations rather than verifiable rules. 'Write good error handling' is an aspiration. 'Every async function must have a try/catch block and log errors to the structured logger before re-throwing' is a verifiable rule.

KEY POINTS
1 Rules must be specific and verifiable — Claude (and code review) can check if they're followed.
2 Include positive examples (do this) AND negative examples (not this) for the most important rules.
3 Rules should explain WHY — context helps Claude make correct judgment calls in edge cases.
4 Prioritize rules — not every rule is equally important. Mark critical ones explicitly.
5 Rules decay — review CLAUDE.md quarterly and remove rules that no longer apply.