[FEATURE] CLAUDE.ms (and other rules) - Sizing alerts, auto consolidation on write, auto review suggestions
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When CLAUDE.md and other instruction files (.claude-*, project docs, etc.) consume a significant portion of the context window, Claude Code should proactively notify the user.
Something like:
"Your instruction files total ~15K tokens (X% of your context window). This may limit conversation length and cause 'prompt too long' errors. Would you like help consolidating them?"
Why this matters:
Instruction files tend to grow organically — a rule gets violated, so a checklist gets added, then a meta-checklist to enforce the checklist. Users don't realize the cumulative token cost because there's no visibility into it. They hit a cryptic "prompt too long" error on a 4-word prompt and have no idea why.
Proposed Solution
Suggested behavior:
- On session start, calculate total tokens consumed by auto-loaded instruction files
- If above a threshold (e.g., 10-15% of context window), surface a warning
- Optionally offer to review and consolidate — Claude Code is well-suited to distill verbose instructions into concise rules without losing meaning
This would be especially helpful for users who've inherited instruction files from earlier Claude Code sessions that generated overly verbose guardrails.
Alternative Solutions
I just found out it was an issue when a chat stopped responding altogether and I was investigating in another chat. I used that chat to review and chop down claude written instruction sets that were consuming context at an alarming rate but with:
1) no warning this was happening
2) no rational reason why it would self-write bloated, repetitive instructions sets without auto-reviewing/condensing.
Priority
Medium - Would be very helpful
Feature Category
Performance and speed
Use Case Example
Every day.
This provides better performance and adherence to rules:
I ask claude to do or not do something, it writes that to it's ruleset. BEFORE it does that, it review that ruleset for existing similarity and reinforces as needed instead of adding duplicates.
This provides better value and experience to users:
I send a request and claude sends back a message saying, 'hey, I notice your rulesets are eating up a lot of context per prompt, would you like me to help review and condense them'?
Additional Context
Claude Code can see the token count — it knows when instructions are eating 30% of the context window before a single message. A proactive nudge like "your instruction files total ~15K tokens, which is X% of your context — want me to help consolidate?" would save people a lot of debugging.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗