Claude Code: Compaction Recovers Instead of Ending in "Prompt Is Too Long"

Claude CodeView original changelog

Claude Code 2.1.332 hardens long conversations against compaction failures. A cut-off summary now triggers a retry that asks for a shorter one, repeated auto-compaction failures get one more attempt at the context limit, and proxies with request size limits no longer leave every message and /compact failing with a 413.

Key Takeaways

  • A cut-off summary now triggers a retry, with a final attempt that asks for a shorter summary after three failures.
  • Repeated auto-compaction failures get one more try at the context limit instead of ending in "Prompt is too long".
  • 413 errors behind proxies are handled better, so messages and /compact can recover from request size limits.
  • Idle compaction runs for subscribers well under their weekly limit, where it was previously skipped.
  • Resuming long conversations uses less memory.
  • Resumed sessions on third-party providers keep their last messages after a crash or kill.

Long sessions survive compaction trouble

Compaction is what keeps long Claude Code sessions alive, and when it fails the session often becomes unusable. Claude Code 2.1.332 closes several of those failure paths.

Summaries that run past the output limit

When a compaction summary kept running past the output limit, compaction used to fail. After three cut-off replies, Claude Code now makes a final attempt that asks for a shorter summary, so the conversation is compacted rather than abandoned.

"Prompt is too long" after repeated failures

Turns could end in "Prompt is too long" after repeated auto-compaction failures, even when one more compaction at the context limit would have kept the session going. Claude Code now makes that extra attempt.

Proxies and gateways with size limits

Behind a proxy or gateway with a request size limit, every message and /compact could fail with a 413. Recovery for long conversations in that setup has been improved, so sessions can shrink the request and continue.

Other long-session improvements

  • Idle compaction is no longer skipped for subscribers who are still well under their weekly limit.
  • Memory use when resuming a long conversation is lower.
  • Resuming a session and /stats no longer freeze for seconds when a transcript holds many damaged lines.
  • A resumed conversation on Bedrock, Google Cloud's Agent Platform, Foundry and other third-party providers no longer sometimes misses its last messages after a crash or kill.