Skip to main content

CLAUDE.md overload: long or conflicting rules obscure key conventions

PhaseImplementationRolesEngineer · ArchitectSeverityMediumApplies toAll coding agentsEvidenceOfficial docs

In one sentence: you pour every convention you can think of into CLAUDE.md, hoping I'll cover all of it. When rules proliferate or conflict, I may miss key requirements. Check actual loading and task results.

Symptom​

CLAUDE.md is the project handbook I read every time. I often see it grow longer and longer: code style, directory conventions, naming rules, commit format, dozens of "always" and "never" clauses. The intent is good, but once it hits several hundred lines, you'll notice I start ignoring parts of it—and not necessarily the parts you'd consider least important.

Why this happens​

Persistent instructions consume context and may conflict, become outdated, or disagree with the code. More rules make maintenance and verification harder, but there is no established universal allowance of “150–200 reliably followed instructions” for frontier models.

Look beyond line count: which facts can I discover from the repository, which apply only to certain paths, which are team decisions, and which hard boundaries belong in permissions, hooks, or CI?

Consequences​

  • Key constraints get dropped, while you assume they're "already in the spec."
  • The longer the file, the larger the fixed overhead on every session, and the smaller the window left for the actual task.
  • It's hard to tell which rules are doing anything and which are dead letters.

What to do instead​

Keep short instructions with a clear purpose and verify loading and behavior.

  1. Retain real build/test commands, decisions not inferable from code, and recurring traps.
  2. Diagnose repeated errors: missing loading, conflict, stale content, or a need for enforcement. Do not append “always” after every mistake.
  3. Remove outdated, redundant, or externally enforced rules. Never having violated a safety convention does not by itself make it redundant.
  4. Scope local rules by path and load procedures through skills when needed. Inspect the content added by references and automatic memory.
  5. Test important constraints on representative tasks before and after trimming; shortness alone is not the metric.

Example​

Before (excerpt, 200+ lines):

- Name variables in camelCase
- Don't use var
- Comments must be complete sentences
- Functions no longer than 50 lines
- Prefer const
- Every file needs a copyright header at the top
- … (190 more lines)

After (10 lines, each tied to a real lesson):

# Build & test
- After changing code, run `npm test`; ship only when green.

# Traps this project has hit
- Database migrations must be reversible (a missing rollback caused a prod incident).
- Store all times in UTC (mixing time zones caused a bug).

Tool differences​

As of 2026-10-29, Gemini CLI's hierarchical context, Codex's AGENTS.md, Cursor's conditional rules, and custom instructions across Copilot surfaces have different discovery/loading behavior. Check accumulated context, scope, size limits, and truncation warnings rather than inspecting only the file you edited. Use current documentation for exact limits and defaults.

Version notes​

Verified 2026-10-29

Instruction volume, conflicts, loading behavior, and model capability all matter. This entry sets no cross-model instruction-count threshold. Check hierarchy, truncation, and path scope against current documentation and actual loaded content.

Further reading and sources​