{"version":"2.1.324","anchor":"reactive-compact-can-keep-a-token-budgeted-tail-of-recent-me","canonical_anchor":"reactive-compact-can-keep-a-token-budgeted-tail-of-recent-me","heading":"Compacting after a prompt-too-long error can keep more recent messages","tier":"notice","area":"Compaction","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324\/e\/reactive-compact-can-keep-a-token-budgeted-tail-of-recent-me","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324","markdown":"### Compacting after a prompt-too-long error can keep more recent messages\n\nEmergency compaction can now keep as many recent messages as fit in a token budget, and handles errors where the overflow size cannot be read\n\n**Unclear.** It is not clear whether anything sets the token budget yet, so the extra kept messages may not happen in practice.\n\n**What**\n\nCompaction means Claude Code summarizes older parts of a conversation so it fits in the model's limit. When a request fails because the prompt is too long, Claude Code compacts on the spot.\n\nThat step can now be given a token budget for recent messages. Tokens are the small chunks of text the model counts. Claude Code counts how many of the most recent message groups fit in that budget and keeps whichever is larger: that count or the number it already kept.\n\nThere is also a new way of handling the case where Claude Code cannot work out from the error how far over the limit the prompt is.\n\n**Why**\n\nAfter a prompt-too-long error, compaction can hold on to more of the latest conversation, so Claude loses less recent context.\n\n- Area: Compaction\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}