Skip to content

Claude Code

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

Written by an AI model from the linked sources and checked against them by a second model. How we work

All about: Claude Code versions and changes →
Image: zernie.com

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.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.