What probably matters to youSection of the release
What
Hooks 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:
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.
Why
A 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.
How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agreeFixed PreCompact, PostCompact and post-compaction SessionStart hooks not receiving agent_id and agent_type when a subagent compacts