Conversation compaction fails with "too long" error after adding conversation history navigation feature
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
After the recent update that added the ability to navigate backward/forward in conversation history (undo/redo), Claude Code can no longer automatically compact long conversations. When the conversation becomes too long, the terminal throws an error saying the conversation cannot be compacted because it's too long, and the session becomes unusable.
Impact
This is a significant UX regression. Previously, automatic compaction worked well and allowed for long working sessions. The new history navigation feature appears to keep the full context, which prevents compaction from working.
Users now have to reset conversations much more frequently, interrupting their workflow and losing context.
Expected Behavior
Long conversations should be compactable even with the history navigation feature enabled, or there should be a way to disable history navigation to allow compaction to work as before.
Actual Behavior
When conversation length reaches a certain threshold, compaction fails completely with an error message, forcing users to start a new conversation.
Suggested Solutions
- Allow compaction to work with history navigation enabled
- - Provide a setting to disable history navigation in favor of auto-compaction
- - - Implement partial compaction that preserves recent history while compacting older messages
What Should Happen?
Long conversations should be automatically compactable even with the history navigation feature enabled. Alternatively, there should be a setting to disable history navigation in favor of auto-compaction functionality.
Error Messages/Logs
Steps to Reproduce
- Start a new Claude Code session
- 2. Have a long conversation with multiple back-and-forth exchanges
- 3. Continue the conversation until it reaches the token limit
- 4. Observe that the terminal displays an error message stating the conversation is too long and cannot be compacted
- 5. Session becomes unusable and requires starting a new conversation
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Latest version (version after history navigation feature was added)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Terminal: Kitty
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗