[BUG] CRITICAL: Context Window Auto-Compact Malfunction - Infinite Loop
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 6 comments · opened Aug 25, 2025 · closed Aug 26, 2025
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ x] Other: <!-- specify --> Claude Code
- Claude CLI version: <!-- output of
claude --version--> Claude Code v1.0.90 - Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 --> Debian 12
- Terminal: <!-- e.g. iTerm2, Terminal App --> Putty
Bug Description
<!-- A clear and concise description of the bug -->
When trying to use Claude Code, it is auto-compacting and then IMMEDIATELY showing "Context left until auto-compacting: 2%" or less. It is also burning through my usage window vastly sooner than it used to. Here is Claude's description:
CRITICAL CONTEXT WINDOW MALFUNCTION - IMMEDIATE ACTION REQUIRED
CRITICAL FAILURE DETECTED
- Date: 2025-08-25 19:37
- Session: CLC Dashboard Power BI project
- Status: COMPLETE SYSTEM MALFUNCTION
THE PROBLEM
- Impossible Context Behavior: Auto-compacted, then immediately showed 1% until next auto-compact
- Usage Limit Hit: Consumed user's usage limit while accomplishing NOTHING
- Broken Compression: Context compression is failing catastrophically
- Infinite Loop: Stuck in compact-lose-context-compact cycle
REQUIRED FIXES (NOT WORKAROUNDS)
- Context Window Algorithm: The auto-compact threshold is broken
- Compression Ratio: Context is being lost instead of compressed properly
- Usage Tracking: System is charging tokens for failed operations
- Loop Detection: Need circuit breaker for compact cycles
Steps to Reproduce
- <!-- First step --> Start Claude Code
- <!-- Second step -->Try to get it to do something.
- <!-- And so on... -->It auto-compacts within minutes.
Expected Behavior
<!-- What you expected to happen -->
Uh, I expected it to do something.
Actual Behavior
<!-- What actually happened -->
It auto-compacted OVER AND OVER.
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
6 Comments
Workaround: Rename or remove the settings.local.json file from .claude folder.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
My settings.local.json is only 38 lines. That is not the root cause.
It's a proven workaround for when you're in a compact loop. It's worth a shot in your case.
Did not help my situation.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.