Enforcing CLAUDE.md rules linters can't check by compiling them into yes/no tests

feursteiner · reddit · 2026-11-22

A Reddit thread on making Claude Code honor CLAUDE.md rules no linter can check, e.g. 'new checkout flows must reuse the existing pricing policy' — Claude sometimes quietly redoes discount logic with nothing forbidden imported. The author's approach (open-source agentests): keep each rule as one plain sentence, have Claude compile it into a few narrow yes/no questions, and run them via a pre-commit hook. Asks how others handle it: hooks, a review subagent, or reading every diff.

Original post →

More from coding & agent

coding & agent channel →