How to Prevent CLAUDE.md Rot: Treat Rules Like Code

After running Claude Code on production projects for 18 months, u/mm_cm_m_km identified the single most common failure point: the CLAUDE.md file rots. Not because Claude ignores it, but because developers keep adding rules without ever cleaning them up. The result is a bloated 500-line file that costs tokens every turn and drifts out of sync with the actual codebase.
1. CLAUDE.md as an Index, Not a Manual
Keep CLAUDE.md to 30–50 lines. It should act as a table of contents pointing to specific files for specific concerns — not a wall of every preference you have ever set. Claude rereads the file on every turn; short files are cheap, long files waste tokens and attention.
2. Every Section Answers One of Two Questions
- What behavior do you want? (the rule) — belongs in
CLAUDE.md. - Where do you find the current truth? (the source) — belongs as a fetchable URL or file path Claude can re-read at task time.
Mixing rules and sources is how files grow without bound. Keep the rule short, the source external.
3. Audit Before Merge, Not After
Rules silently drift as you rename things, refactor hooks, or drop features. The fix is not "be more careful" — it is a CI step. The author built a GitHub App called agentlint (agentlint.net) that audits the rules surface on every PR: contradictions across files, references to deleted paths, rules describing harness features your version does not support.
4. Delete More Than You Add
Almost every CLAUDE.md gains one new rule per week and deletes zero. After six months you have a Frankenstein. The discipline: for every new rule, find one to delete. This has kept the author's file under 100 lines.
The core pattern: treat your rules surface like code. Code has tests, review, and drift detection. Rules need the same.
📖 Read the full source: r/ClaudeAI
👀 See Also

Practical Claude Code Workflow Tips for Complex Development Projects
A Claude Pro user shares specific workflow strategies for developing complex audio plugins, including using planning mode for major features, creating context files, managing token usage, and implementing validation steps.

Claude Code Headless Mode with --print Flag
Claude Code can run in headless mode using the --print flag, allowing prompts to be piped in for automated output without interactive sessions. This enables integration into CI/CD pipelines, git hooks, and bash scripts.

How to disable Claude Code's verb spinner feature
Claude Code includes a default verb spinner that displays whimsical gerunds like 'Seasoning' and 'Crafting' during processing. You can disable it by editing the settings.json file with a blank space in the spinnerVerbs array.

MTP Acceptance Rate: 50% Threshold Determines Speculative Decoding Benefit
MTP (Multi-Token Prediction) via speculative decoding on Gemma-4 26B shows benefit only when draft token acceptance rate exceeds 50% — based on mlx-vlm benchmarks on M4 Max Studio.