What
After shutdown is committed, every hook event other than SessionEnd stops running, and pressing Ctrl-C no longer aborts the in-flight request. Your PostToolUse and other hooks will not fire during an exiting session.
Details
- A commit latch is set by the synchronous shutdown path; hook dispatch then waits on a promise that never resolves, both before dispatching and before returning results.
SessionEndis the sole exception, so end-of-session hooks still run.- The REPL interrupt handler becomes a no-op for the duration, so Ctrl-C during shutdown does nothing rather than cancelling.
Evidence
hookEventName: wt("PostToolUse")
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Names in the bundleSessionEnd
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.
Added since
A small documentation edit on Environment variables touched a line naming SessionEnd after this was published.
| `CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS` | Override the time budget in milliseconds for [SessionEnd](/docs/en/hooks#sessionend) hooks. The value is also the timeout for each hook that sets no `timeout` of its own. Applies to session exi…env-vars see the edit
Confirmed since
Anthropic's documentation has since written up SessionEnd, on List Events.
- `stop_reason: BetaManagedAgentsSessionEndTurn or BetaManagedAgentsSessionRequiresAction or BetaManagedAgentsSessionRetriesExhausted or BetaManagedAgentsSessionBudgetReached`api/beta/sessions/events/list see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up SessionEnd, on List Events.