Developers are increasingly stuffing CLAUDE.md and AGENTS.md files with prose rules that agents often ignore or over-consume in tokens. A new open-source tool, codemyrules, proposes a radical shift: treat these prose conventions as lint rules. The tool analyzes majority patterns in code, Architecture Decision Records (ADRs), and existing documentation to generate enforceable ESLint or ast-grep rules. By converting soft prose into hard lint checks, it aims to reduce token waste and ensure agents adhere to project standards without constant manual intervention.

The Token Tax of Prose Rules

Current agent workflows suffer from inefficiency because prose rules in agent docs are loaded into context for every session, regardless of relevance. This creates a significant token overhead, with the source noting a cost of approximately $0.009 per 1,000 tokens per Sonnet session for unnecessary lines. Furthermore, agents frequently ignore these prose instructions, leading to code that violates established conventions. The codemyrules approach replaces these verbose instructions with silent, zero-cost lint checks that only trigger when a rule is actually broken, providing immediate feedback rather than delayed review comments.

Benchmarking Rules Against Prose

The tool’s design is backed by an experiment involving 124 headless Claude Code sessions on a real Kotlin/Spring backend. The data reveals that while prose rules were ignored in most runs (Sonnet 8 of 8, Haiku 5 of 8), converting them to lint rules with a brief pointer in CLAUDE.md resulted in zero violations. Although the initial draft cost slightly more due to correct code generation, the overall cost per task dropped by about 22%, with a third fewer turns required. This suggests that enforceable rules are more cost-effective than relying on agents to remember and apply prose instructions.

Implementation and Stack Support

codemyrules supports a wide range of languages, using ESLint for JavaScript, TypeScript, Vue, and Svelte, and ast-grep or existing linters for Java, Kotlin, Python, Go, C#, PHP, Rust, and Ruby. The tool operates in three tiers: a fast tier for immediate post-edit feedback, a full tier for end-of-turn checks, and a CI safety net. Crucially, it only blocks new code from breaking rules, ignoring legacy issues to keep CI green. The feedback loop is currently exclusive to Claude Code, with support for other harnesses like Codex and Cursor in development.

Key Takeaways

  • Prose rules in agent docs are often ignored and waste tokens; lint rules are enforceable and silent when passing.
  • Benchmark data shows a 22% cost reduction and fewer turns when using lint rules with pointers instead of full prose.
  • The tool supports multiple languages via ESLint and ast-grep, focusing on new code enforcement while ignoring legacy debt.
  • Currently, the automated feedback loop is exclusive to Claude Code, though rules generation works across other AI coding assistants.

The Bottom Line

Stop trusting LLMs to remember your prose rules. Enforce them with linters, save tokens, and stop the cycle of ignoring instructions.