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.
Up next
GLM-5.2 (max) matches Claude Opus 4.8 on Harvey LAB-AA
GLM-5.2 (max) matched Claude Opus 4.8 on all-pass rate in the legal-task benchmark Harvey LAB-AA, per an independent Artificial Analysis measurement. Harvey’s scoring is strict: a task counts only if every rubric criterion passes, no partial credit.
Related stories
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

