{"version":"2.1.323","anchor":"precompact-hook-output-cut-now-carries-a-marker-and-hook-inp","canonical_anchor":"precompact-hook-output-cut-now-carries-a-marker-and-hook-inp","heading":"Compaction and session-start hooks are now told which agent triggered them","tier":"use","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.323\/e\/precompact-hook-output-cut-now-carries-a-marker-and-hook-inp","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.323","markdown":"### Compaction and session-start hooks are now told which agent triggered them\n\n`PreCompact`, `PostCompact` and `SessionStart` hooks now receive the agent's identity, and cut-off hook output is now marked\n\n**What**\n\nHooks are your own commands that Claude Code runs at set moments. Compaction is when Claude Code shortens the conversation so it fits in the model's memory. These hooks now receive details about the agent (Claude itself, or a helper assistant it started) that triggered them:\n\n- `PreCompact` and `PostCompact` now receive the agent's ID and agent type.\n\n- `SessionStart` now receives the agent's ID.\n\n`PreCompact` also gains a new option called `besideTheTurn`. When a hook's output is longer than the allowed limit, the text that remains after the cut now starts with a marker.\n\n**Why**\n\nA hook can now tell which agent set it off and act on that, for example by treating a helper assistant differently from the main conversation.\n\n- Area: Hooks\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}