Claude Code v2.1.229 ·
Hooks are handed a session object instead of reading globals
Hooks now get an explicit session with id, working directory and project root instead of guessing from globals.
Under the hoodTier: how much it should matter to you
2Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
ElsewhereArea: what it touches
Internal ChangesKind: in v2.1.229,
Internal ChangesSection of the release
What
Hook entry points now receive an explicit session built from the session id, original working directory and project root, rather than reading ambient state. Covers ConfigChange, FileChanged, CwdChanged, Notification, DirectoryAdded, SessionEnd, StopFailure, WorktreeCreate and Remove, PreCompact and PostCompact, and Elicitation.
Evidence
hook_event_name: "CwdChanged"
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
See this entry in the whole of v2.1.229 →