Enforce your CLAUDE.md rules in CI, not in a markdown file

A rule in CLAUDE.md is a suggestion: the agent follows it almost every time, but about 12% of violations still slip into prod. A CI check is law. Code that breaks the rule simply won't merge. That gap matters when an agent ships more code in an evening than a reviewer can read in a week.
The highest-leverage move, the author argues, is turning on ESLint's complexity limits that almost nobody enables: complexity, max-depth, max-lines-per-function, max-params, max-statements, plus cognitive-complexity from SonarJS. Without them, the agent hands you a 150-line function with a switch inside a try-catch inside a loop.
Complexity limits act as a proxy. Hit max-lines-per-function and the agent will either split the function into single-use helpers or drop in an eslint-disable-next-line. So the author says to ban disable comments outright with eslint-plugin-eslint-comments.
Related stories
Comments
No comments yet. Be the first.
Join the conversation
Sign in with Google to leave a comment. Your name and avatar come from your Google profile, and the comment appears after moderation.
