2. The Context Budget
Token Math
A concrete baseline for a mid-size project:
| Source | Typical Token Range |
|---|---|
| Global CLAUDE.md | 1,000 – 3,000 tokens |
| Project CLAUDE.md (root) | 2,000 – 8,000 tokens |
| Path-scoped modules (all active) | 1,000 – 5,000 tokens |
| Imported skills / commands | 500 – 3,000 tokens |
| Total always-on context | ~5,000 – 20,000 tokens |
Claude Sonnet 5 has a native 1M token context window. That means even a large always-on configuration budget (20K tokens) occupies about 2% of the window, leaving roughly 980K tokens for actual work: code files, conversation history, tool outputs. (Earlier models like Sonnet 4.6 topped out at 200K, where the same 20K budget cost about 10% of the window.)
The practical rule: always-on context should stay below 5% of the context window. Beyond that, you are displacing actual task content, which matters more per token than standing instructions.
The 150-Instruction Ceiling
Empirical observation from teams running large CLAUDE.md files: beyond approximately 150 distinct rules, models begin selectively ignoring some of them. This is not a hard cutoff (it depends on rule complexity, overlap, and placement), but it is a reliable signal that more rules does not equal better adherence.
The mechanism is attention diffusion: when a prompt contains hundreds of potentially relevant constraints, the model's attention is split across them. High-salience rules (recent, strongly worded, placed early) crowd out lower-salience ones.
HumanLayer's production data shows teams with structured context (fewer, more specific rules, organized hierarchically) see 15-25% better adherence than teams with undifferentiated long rule lists.
Implication: rule quality beats rule quantity. Twenty specific, actionable rules outperform 200 generic aspirational ones.
Adherence Degradation by File Size
Lines in CLAUDE.md Adherence (estimated)
───────────────── ─────────────────────
1 – 100 ~95%
100 – 200 ~88%
200 – 400 ~75%
400 – 600 ~60%
600+ ~45% and fallingThese are estimated baselines, not guarantees. Path-scoping and modular architecture can maintain higher adherence at larger total rule counts by ensuring that only relevant rules are in context at any given time.
Signs of Context Overload
When always-on context becomes too large or too noisy, you see predictable failure modes:
- Rule silencing: Claude follows 80% of conventions consistently but ignores specific rules that should apply.
- Contradictory behavior: Claude applies a rule in some files but not others, or applies contradictory rules depending on phrasing.
- Slow first responses: The model spends more time processing a large context before generating output (observable in longer latency for simple tasks).
- Generic outputs: Instead of applying project-specific patterns, Claude falls back to generic best practices, a sign that project context is not being retained.
When you see these patterns, the diagnostic is: run a context audit (see Section 7), not more instructions.
MECW: Maximum Effective Context Window
The advertised context window and the effective context window are not the same number. Enterprise context engineering deployments consistently find that meaningful accuracy degradation begins before the stated limit is reached. The commonly cited figure from production experience: approximately 92% of the advertised limit.
For Claude Opus 4 (200K advertised), this puts the practical ceiling at approximately 185K tokens before accuracy measurably degrades on complex reasoning tasks. The mechanism is the n² attention scaling described in Section 1 (Why Context Rot is Structural): as the context grows, attention operations scale quadratically, and mid-window positions receive diminishing effective weight.
Context rot degrades accuracy by 30%+ in mid-window positions under heavy context load. The practical implication: a 128K-token context window with high-quality, well-maintained content outperforms a 1M-token window with stale, accumulated content. The 1M window does not eliminate the problem; it delays it while increasing the cost of each request.
The question "should I just use the 1M context window?" is really a question about signal-to-noise, not capability. A larger window that accumulates tool output noise, expired conversation turns, and redundant instructions is not more powerful than a smaller, curated one. It is just more expensive and slower.
Practical MECW targets:
| Window | Advertised | Practical ceiling (92%) | When rot degrades accuracy |
|---|---|---|---|
| Claude Sonnet 4.6 | 200K | ~184K | ~150K+ |
| Claude Opus 4 | 200K | ~185K | ~150K+ |
| Claude Sonnet 5 | 1M | not yet benchmarked | not yet benchmarked |
These are engineering estimates, not guaranteed values. Treat them as planning figures: if your session regularly approaches 150K tokens, it is time to implement compaction, graduated offloading, or path-scoping before accuracy becomes a problem, not after.
A sharp, non-linear quality drop shows up around 70% of the context budget used, rather than a smooth decline. Nine speakers at the same meetup independently reported this same threshold, which this guide reads as a notably strong signal for a claim usually offered as a vague hunch. The practical consequence is about timing: purge or compact context before crossing that threshold, not after the drop already shows up in the output. (Emmanuel Sciara, Dev With AI Meetup, 2026. Malo and Dorian, same event and year, describe the same shift as abrupt rather than gradual.)
Path-Scoping and Budget Efficiency
Path-scoping is the most effective single technique for reducing always-on context. Instead of loading all rules for all parts of the codebase, you load only the rules relevant to the files currently in context.
A typical project without path-scoping:
Always-on: root CLAUDE.md with backend + frontend + database + API rules = 8,000 tokensThe same project with path-scoping:
Always-on: root CLAUDE.md with shared rules = 2,000 tokens
Active when in src/api/: api module = +1,500 tokens
Active when in src/components/: frontend module = +1,200 tokens
Active when in prisma/: database module = +800 tokensResult: 40-50% reduction in always-on context, with no loss of coverage. Each subsystem gets its full rule set, but only when working in that subsystem.