Deadlock: context limit reached but /compact and rewind both fail with 'Conversation too long'

Resolved 💬 3 comments Opened Feb 6, 2026 by Hormold Closed Feb 6, 2026

Bug Description

When a conversation hits the context limit, the user enters a completely unrecoverable deadlock — the app becomes a brick that can only be escaped by force-killing the process.

Every single recovery path fails:

  1. Sending any message → blocked with "Context limit reached · /compact or /clear to continue"
  2. /compact → fails: "Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again."
  3. Rewind (Esc twice) → fails: "Error: Failed to summarize: Error: Conversation too long. Press esc twice to go up a few messages and try again."
  4. /clear → also blocked by the context limit gate — can't even type commands
  5. No way to exit the screen — the UI is completely frozen in this error state

The only escape is force-closing the terminal / killing the process. The user loses the entire session.

Expected Behavior

/compact should always work when the context limit is reached — that's its entire purpose. If the conversation is too long for a single compaction pass, it should:

  • Compact in chunks/passes
  • Drop older messages to make room for the compaction summarization call
  • At minimum, /clear and /compact should NEVER be blocked by the context limit gate — they are recovery commands, not regular messages
  • Or offer a graceful degradation (e.g., "compact last N messages only")

Steps to Reproduce

  1. Have a long conversation with many tool calls and large file reads (heavy CLAUDE.md + skills + MCP tools helps)
  2. Hit the context limit
  3. Try /compact → observe the error
  4. Try rewind (Esc twice) → observe the same error
  5. Try /clear → also blocked
  6. User is now completely trapped — no input accepted, no way to recover, must kill the process

Screenshot

<img width="1706" height="573" alt="Image" src="https://github.com/user-attachments/assets/74fc1257-849f-41cb-9151-93ab5d693e6f" />

Environment

  • Claude Code CLI
  • macOS (Darwin 24.0.0)
  • Large project with extensive CLAUDE.md, multiple skills, and MCP servers configured

Impact

Complete app freeze / force-quit required. This isn't just data loss from /clear — the user cannot interact with the app AT ALL. The session is bricked. The only option is to close the terminal and start over, losing all context, tool state, and in-progress work.

The compaction feature exists precisely for this situation but fails exactly when it's needed most — creating an inescapable deadlock instead of recovering gracefully.

View original on GitHub ↗

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