{"version":"2.1.290","anchor":"compaction-precompact-hook-trigger-reports-auto-vs-manual","canonical_anchor":"compaction-precompact-hook-trigger-reports-auto-vs-manual","heading":"PreCompact hooks are now told when compaction was automatic","tier":"use","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.290\/e\/compaction-precompact-hook-trigger-reports-auto-vs-manual","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.290","markdown":"### `PreCompact` hooks are now told when compaction was automatic\n\nThe PreCompact hook now receives a trigger of auto for automatic compaction instead of always manual\n\n**Unclear.** It is not clear whether automatic compaction ran these hooks through this same path before.\n\n**What**\n\nCompaction 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.\n\nThe `trigger` value the hook receives is now `auto` when compaction happens automatically. Before, it was always `manual`.\n\n**Why**\n\nA `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`.\n\n- Area: Hooks\n- Names: `PreCompact`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}