All insights

CLAUDE.md should be a routing table, not a knowledge base

Treat CLAUDE.md as a minimal IF-ELSE directory pointing to context files — not a 26,000-line monolith that bloats every session

@systematicls — How To Be A World-Class Agentic Engineer · · 7 connections

The most effective CLAUDE.md is “a logical, nested directory of where to find context given a scenario and an outcome” — as barebones as possible, containing only the IF-ELSE routing of where to seek context. If coding, read coding-rules.md. If tests are failing, read coding-test-failing-rules.md. Rules encode preferences; skills encode recipes. This nested conditional structure lets agents load precisely the context they need without polluting their window with irrelevant instructions.

This is a specific instance of The context window is the fundamental constraint — everything else follows — every unnecessary line in CLAUDE.md taxes every session. The routing-table pattern also complements Skill graphs enable progressive disclosure for complex domains, where agents navigate to deeper knowledge only when needed rather than loading everything upfront. As rules and skills accumulate, they inevitably contradict each other and degrade performance — periodic consolidation (“spa days”) keeps the system clean, which connects to why Compound engineering makes each unit of work improve all future work requires active maintenance, not just accumulation.