[BUG] /compact always fails with "Conversation too long" since v2.1.23 (regression)

Resolved 💬 5 comments Opened Jan 30, 2026 by tangtom Closed Mar 15, 2026

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?

Since upgrading to version 2.1.23, /compact command always fails with the error:

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

This happens even when context usage is relatively low (e.g., 50-60%).

Before v2.1.23: Compact worked reliably, I could compact multiple times in a single session.

After v2.1.23: Compact fails 100% of the time, making long sessions unusable.

Impact: This bug makes Claude Code unusable for any task requiring extended sessions, forcing users to start new sessions and lose all context.

Similar issues reported in #21398, #18211, #15896

What Should Happen?

/compact should successfully summarize the conversation and reduce context usage, as it did in versions prior to 2.1.23.

Error Messages/Logs

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

Steps to Reproduce

  1. Start a Claude Code session
  2. Work until context reaches ~50-60%
  3. Run /compact
  4. Observe error: "Conversation too long"

Note: The workaround "press esc twice" doesn't help when the previous message is already a compaction attempt. Auto-compact also fails with the same error.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.22

Claude Code Version

2.1.25

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Cursor

Additional Information

  • Using Claude Code for VS Code extension in Cursor
  • This appears to be a regression introduced in v2.1.23
  • Similar issues reported in #21398, #18211, #15896
  • Plan: Claude Max
  • The workaround "press esc twice" doesn't help when the previous message is already a compaction attempt
  • Auto-compact also fails with the same error

View original on GitHub ↗

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