Make the 40,000-char CLAUDE.md warning threshold configurable (or scale with context window)

Resolved 💬 1 comment Opened May 5, 2026 by IanVand Closed Jun 2, 2026

Summary

Claude Code prints Large C:\...\CLAUDE.md will impact performance (40.3k chars > 40.0k) when the user CLAUDE.md exceeds 40,000 characters. This threshold appears to be hardcoded -- no settings.json key, env var, or CLI flag controls it.

Why this is worth revisiting

The 40,000-char ceiling predates the 1M-token context window that's now available on Opus 4.7 and Sonnet 4.6. 40,000 characters is roughly 10k tokens -- about 1% of a 1M context. The "impact performance" framing made sense when the default window was 200k (5%), but at 1M the warning fires well below any meaningful performance threshold.

I maintain a fairly dense user CLAUDE.md (policies, tool preferences, portfolio conventions) and recently had to shuffle ~1.5 KB of load-bearing text into a sibling reference file just to silence the warning. The content is cheaper to keep in CLAUDE.md where it's always loaded than to gate behind a "fetch this reference file" step the model has to remember to take.

Request

Any of:

  1. Expose the threshold as a setting (e.g. settings.jsonclaudeMdWarningThreshold: 80000).
  2. Scale the default with the selected model's context window (e.g. warn at 1% of context).
  3. Add an env var or --no-claude-md-size-warning flag to suppress it.

Option 1 is the most flexible; option 2 is probably the most principled since it tracks the actual cost.

Environment

  • Claude Code CLI (Windows, npm-installed, Opus 4.7 [1M])
  • Seen on user CLAUDE.md at 40,302 chars

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗