Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.326 ·

Compaction can run even when a PreCompact hook blocks it

If a request cannot be sent without compacting, Claude Code now compacts anyway even when a PreCompact hook blocks it, and logs that it did

You'll notice Improvements
JSON All of v2.1.326
You'll noticeTier: how much it should matter to you
3Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
CompactionArea: what it touches
ImprovementsKind: in v2.1.326,
ImprovementsSection of the release
What

Compaction shortens the conversation by summarising earlier parts so it fits in what the model can read at once. A PreCompact hook is a command you set up to run before compaction, and it can block the compaction.

When a request is too large to send as it is, Claude Code compacts in response. In that case it now compacts even if a PreCompact hook blocks it, and writes a log line saying so. Before, a block from the hook always stopped the compaction.

Why

It keeps a session from getting stuck when the conversation has grown too large to send. If you rely on a PreCompact hook to block compaction, it no longer stops this case.

Read from
Names in the bundlePreCompact
Since it was published

The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.

Confirmed since Anthropic's documentation has since written up PreCompact, on Intercept and control agent behavior with hooks. A callback that exceeds its timeout follows [Hook timeout](#hook-timeout). With `"block"` set, a timeout also blocks `PreCompact` and `Elicitation`. agent-sdk/hooks see the edit
How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up PreCompact, on Intercept and control agent behavior with hooks.

See this entry in the whole of v2.1.326 →

Feedback