Compaction fails with 'Conversation too long' error when context is large

Resolved 💬 3 comments Opened Apr 4, 2026 by mmporong Closed Apr 7, 2026

Bug Description

When attempting to compact a conversation (via /compact or the compact button), the following error appears:

Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again.

Steps to Reproduce

  1. Have a long conversation with Claude Code (large context window usage)
  2. Attempt to compact the conversation
  3. Compaction fails with the above error

Expected Behavior

Compaction should work precisely when the conversation is long — that is the main use case for it. If the context is too long to compact, Claude Code should:

  • Either compact a subset of older messages
  • Or provide a clearer explanation of what the user should do

Actual Behavior

Compaction itself fails with an error, leaving the user stuck. The error message says to "press esc twice and go up a few messages and try again," but this is not intuitive and doesn't resolve the underlying issue.

Why This Is a Problem

The compaction feature is intended to help users when their conversation gets too long. Failing at exactly that moment is a critical UX issue — it's like a life jacket that doesn't work when you're drowning.

Environment

  • Platform: Windows 11
  • Shell: bash

View original on GitHub ↗

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