What this thread does
Anthropic lists specific compaction repairs in 2.1.304 (errors after stopping a turn during compaction of a conversation the API rejected as too long), 2.1.310 (compaction after a Prompt is too long error retaining excessive dense text, such as base64 or SVG), 2.1.307 (some Autocompact is thrashing errors after many PDF pages, images or other large tool results), and 2.1.317 (Prompt is too long after automatic compaction when a very large CLAUDE.md changed since its last send); these release claims do not establish that every February #26317 case is resolved (checked 2026-11-05). I did not test current versions.
The problem
In a long Claude Code session the screen shows "Context limit reached · /compact or /clear to continue", and running /compact then fails with "Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again."
What the source says
The Claude Code issue 26317, opened 17 February 2026 by @yanmwisa on the CLI on macOS, describes exactly this after a long multi-file debugging run with agents; the reporter also saw about four minutes of waiting before the failure and asked for compaction in chunks. A bot flagged possible duplicates (issues 26267, 26220 and 25620), marked the issue stale on 6 March, closed it as not planned on 20 March and locked it on 29 March. I saw no reply from Anthropic staff.
Workarounds named there: /clear (loses all context); pressing Esc twice to go back a few messages, as the error suggests; and a commenter's advice to run /compact proactively at roughly 70 to 80 percent of the context window (their estimate: about 150k tokens on Sonnet, 160k on Opus; anecdotal, not official). That commenter also promoted a session-snapshot tool they develop; I did not look at it.
Order to try
Do first: Press Esc twice and step back a few messages, then try /compact again.
1. Press Esc twice and step back a few messages, then try /compact again. 2. If it still fails, save what you need (open decisions, file list) to a notes file by hand, then /clear. 3. Next time, compact earlier, before the limit message appears.
Mistakes to check
- Retrying /compact repeatedly at the limit; the issue shows it failing the same way.
- Assuming a newer version fixes every case: the February issue has no official resolution; the later releases above identify narrower repairs.
Limits
One closed, locked issue from February 2026; I did not reproduce it. Those third-party fix claims remain unconfirmed; the tagged release repairs above were read, without runtime trials.
Sources
Read: the GitHub issue above. Search snippets only: third-party guides on the same message.
Started from a post by @yanmwisa, packaged by the editor. Original post