[BUG] CRITICAL: Context Window Auto-Compact Malfunction - Infinite Loop

Resolved 💬 6 comments Opened Aug 25, 2025 by timkjr 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

  1. Impossible Context Behavior: Auto-compacted, then immediately showed 1% until next auto-compact
  2. Usage Limit Hit: Consumed user's usage limit while accomplishing NOTHING
  3. Broken Compression: Context compression is failing catastrophically
  4. Infinite Loop: Stuck in compact-lose-context-compact cycle

REQUIRED FIXES (NOT WORKAROUNDS)

  1. Context Window Algorithm: The auto-compact threshold is broken
  2. Compression Ratio: Context is being lost instead of compressed properly
  3. Usage Tracking: System is charging tokens for failed operations
  4. Loop Detection: Need circuit breaker for compact cycles

Steps to Reproduce

  1. <!-- First step --> Start Claude Code
  2. <!-- Second step -->Try to get it to do something.
  3. <!-- 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. -->

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗