What
A new hook event that fires after conversation compaction completes, letting you run shell commands or prompts in response to compaction.
Details
- Hook event name:
PostCompact - Input includes compaction details and the summary text
- Allows post-processing after compaction (e.g., logging, notification, or custom follow-up actions)
- Hook output: exit code 0 shows stdout to user; other exit codes show stderr only
Evidence
PostCompact hook event definition (search for hook_event_name: C.literal("PostCompact"), "Running PostCompact hooks…")
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agree
Added PostCompact hook that fires after compaction completes