What
A hook is code that runs when something happens in a session, a session being one run of Claude Code. A new session.stop event was added.
- When the events a hook came from include
session.stopbut notsession.start, the hook is now attributed tosession.stop. Before, it was attributed to the first event in its list.
Other changes shipped alongside it:
- New limits:
unprovenCallerMsof 10,000 (10 seconds) andunprovenCallersMaxof 256. - A
hasEndedvalue is now passed to the display that shows a tool's progress. - Adding directories now calls a new sync function,
$wn.
Why
Hooks that run when a session ends are now reported under the event they actually belong to, instead of being labelled with an unrelated earlier event. The other pieces are internal and do not need anything from you.
Names in the bundlesession.stopsession.start
Documented inclaude-code/plugins/mods/reference
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.
Confirmed since
Anthropic's documentation has since written up session.stop, on Mods reference.
| `session.stop` | The user stops Claude, such as with Esc during a turn. Requires Claude Code v2.1.326 or later. | `next(e)` |plugins/mods/reference see the edit
Confirmed since
Anthropic's documentation has since written up session.start, on Use the mods API.
Work that outlives one event, such as checking on something once a minute, runs on a timer you start from `session.start`. A hook itself runs for one event and has a [time limit](https://code.claude.com/docs/en/plugins/mods/reference.md#li…plugins/mods/api 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 session.start, on Use the mods API.