{"version":"2.1.229","anchor":"hooks-are-handed-a-session-object-instead-of-reading-globals","canonical_anchor":"hooks-are-handed-a-session-object-instead-of-reading-globals","heading":"Hooks are handed a session object instead of reading globals","tier":"internal","area":"Elsewhere","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.229\/e\/hooks-are-handed-a-session-object-instead-of-reading-globals","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.229","markdown":"### Hooks are handed a session object instead of reading globals\n\nHooks now get an explicit session with id, working directory and project root instead of guessing from globals.\n\n**What**\n\nHook 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.\n\n**Evidence**\n\n`hook_event_name: \"CwdChanged\"`\n\n- Area: Elsewhere\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 2\/5"}