cd /news/ai-agents/your-claude-md-is-full-of-lint-rules… · home › topics › ai-agents › article
[ARTICLE · art-164531] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Your CLAUDE.md Is Full of Lint Rules in Disguise

A developer built codemyrules, an agent skill that converts coding conventions and agent instructions into executable lint rules, and benchmarked the approach with roughly 500 headless Claude Code sessions across four real Kotlin, Java, Python and TypeScript projects. The benchmark, published as agent-rules-bench, compared rules written as prose in CLAUDE.md against the same rules enforced as lint rules with a feedback loop, arguing that machine-checkable conventions belong in lint rules while prose docs should hold domain knowledge and the why. The generated rules work with any coding agent, though the hook-based feedback loop currently runs only in Claude Code.

by read3 min views4 publishedNov 5, 2026

Every team using coding agents eventually ends up with a growing CLAUDE.md or AGENTS.md.

"Inject a Clock, never call now() directly."

"Fetch data through query composables, never call fetch() in a component."

"Log messages start lowercase."

And twenty more instructions, each added after an agent got something wrong.

The file keeps growing, and every line eats into a limited context window. So you split it into folders and linked docs. Now less gets loaded, but a doc the agent never opens is a rule it breaks.

The agent keeps making the same mistakes.

There's a better split: prose for what only prose can say (business logic, domain knowledge, the why), lint rules for everything a machine can check. A lint rule stays silent while the agent gets it right. When it doesn't, the feedback loop points to the exact line within seconds, and the agent fixes it on its own.

Take the Clock rule. In CLAUDE.md, it's a sentence the agent may or may not follow:

- Always inject a `Clock`. Never call `LocalDateTime.now()` or `Instant.now()` directly.

As an ast-grep rule, it's a check that runs on every edit:

id: inject-clock
language: kotlin
severity: error
message: Don't call now() directly. Inject a Clock and use now(clock).
rule:
  pattern: $TYPE.now()

When the agent writes Instant.now(), it gets feedback like this a few seconds later, while it's still working on the file:

error[inject-clock]: Don't call now() directly. Inject a Clock and use now(clock).
  src/main/kotlin/.../InvoiceService.kt:42

It fixes the code before it ever reaches review. The CLAUDE.md line shrinks to a one-line pointer, or disappears entirely.

I ran about 500 headless Claude Code sessions on four real projects in Kotlin, Java, Python and TypeScript. Each run compared a rule written as prose with the same rule as a lint rule plus a feedback loop.

Methodology, data and harness to rerun it on your own repo: agent-rules-bench.

codemyrules is an agent skill that turns your existing decisions, coding conventions, and agent instructions into executable lint rules.

It works with the knowledge your team already has:

Nothing is changed without your approval. The feedback loop is private by default: it installs into .claude/settings.local.json and is git-excluded, so no tracked file changes until you decide to share it with your team.

The goal isn't to replace your CLAUDE.md or AGENTS.md with a giant collection of lint rules. It's to stop using prose for conventions a machine can check, and keep your docs for the context only prose can give.

The skill picks the first option that fits:

sgconfig.yml. Not every convention is a lint rule. "Keep services small and focused" or "name things after the domain, not the framework" need judgment, and they stay in your docs. codemyrules is for the rules a pattern match can catch.

It also won't turn your CI red on day one. Rules your existing code already breaks go into a separate suggestions layer, so they guard new code without forcing you to fix legacy code first. And the feedback loop only blocks on lines the agent changed, so it never drags the agent into unrelated cleanup.

The generated lint rules work with any coding agent or harness (the tool that runs the agent): Claude Code, Codex, Copilot, Cursor and others.

The feedback loop is built on Claude Code hooks, so for now it's only offered in Claude Code. I'm working on bringing it to Codex, pi, OpenCode, and other coding-agent environments.

In Claude Code, install the plugin:

claude plugin marketplace add clirimajeti/codemyrules
claude plugin install codemyrules@codemyrules

codemyrules drives one sub-skill per stack, so add the ones you need: eslint-pattern-rules for frontend and backend-pattern-rules for backend. The README has the commands, plus setup for other agents.

Then ask your agent:

Turn our ADRs and AGENTS.md into lint rules.

This is the first public release, and I'd love to see what happens when you run it against a real codebase.

Tell me what it found, what it missed, and how much of your CLAUDE.md turned out to be lint rules in disguise.

Comments here and issues on GitHub are both welcome.

── more in #ai-agents 4 stories · sorted by recency
── more on @codemyrules 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/your-claude-md-is-fu…] indexed:0 read:3min 2026-11-05 · —