What
The failsafe timer that forces exit after shutdown begins grew from 3.5 seconds to 5 seconds at both places it is armed, giving SessionEnd hooks more slack. Shutdown can now also seal the session file against further appends, after which both local and remote persistence stop early, and a single final owed entry is written straight to the session file.
Details
- The seal is one-way for the remainder of the process.
- The final-entry write replaces the previous exit re-stamp helper.
- Unconditional; no flag.
Evidence
sealAppendsForShutdown
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.