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.290 ·

PreCompact hooks are now told when compaction was automatic

The PreCompact hook now receives a trigger of auto for automatic compaction instead of always manual

Use it now Improvements
JSON All of v2.1.290
Use it nowTier: how much it should matter to you
3Useful: my rating, 1 to 5
1Signal: worth watching, 1 to 5
HooksArea: what it touches
ImprovementsKind: in v2.1.290,
What probably matters to youSection of the release

Unclear It is not clear whether automatic compaction ran these hooks through this same path before.

What

Compaction is when Claude Code shortens a long conversation by summarising it, so it fits in the model's memory. A hook is a command of your own that Claude Code runs at a set moment. The PreCompact hook runs just before compaction.

The trigger value the hook receives is now auto when compaction happens automatically. Before, it was always manual.

Why

A PreCompact hook can now tell the two cases apart. A hook that matches on trigger will now see auto for automatic compaction, so check any hook that expected only manual.

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 Hooks reference. To find a slow hook, search the log for `Hooks:` lines that end in a duration. In Claude Code v2.1.296 or later, each command hook on a tool event, `UserPromptSubmit`, `SessionStart`, `Stop`, and several other events leaves one when it fin… hooks see the edit
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtIt is not clear whether automatic compaction ran these hooks through this same path before.
Anthropic's documentation agreesAnthropic's documentation has since written up PreCompact, on Hooks reference.

See this entry in the whole of v2.1.290 →

Feedback