claude-code - 💡(How to fix) Fix Make the 40,000-char CLAUDE.md warning threshold configurable (or scale with context window) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56406Fetched 2026-05-06 06:28:55
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

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.

Error Message

  1. Scale the default with the selected model's context window (e.g. warn at 1% of context).

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

Consider adjusting or suppressing the character limit warning for CLAUDE.md files to accommodate larger content without performance impacts.

Guidance

  • Review the current character limit of 40,000 characters and its implications on your workflow, considering the increased context window of 1M tokens in Opus 4.7.
  • Evaluate the potential benefits of exposing the threshold as a setting in settings.json or scaling it with the model's context window.
  • Investigate the possibility of adding an environment variable or CLI flag to suppress the warning, such as --no-claude-md-size-warning.
  • Assess the trade-offs between flexibility, principled design, and simplicity in choosing a solution.

Example

No specific code snippet is provided, as the issue focuses on configuration and design decisions rather than code implementation.

Notes

The solution may depend on the specific requirements and constraints of the Claude Code CLI and its integration with Opus 4.7. Further discussion or experimentation may be necessary to determine the best approach.

Recommendation

Apply a workaround, such as temporarily suppressing the warning or adjusting the content to fit within the current limit, while awaiting a more permanent solution that exposes the threshold as a setting or scales it with the context window.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Make the 40,000-char CLAUDE.md warning threshold configurable (or scale with context window) [1 participants]