{"version":"2.1.246","anchor":"hooks-are-looked-up-through-a-per-session-registry-not-app-s","canonical_anchor":"hooks-are-looked-up-through-a-per-session-registry-not-app-s","heading":"Hooks are looked up through a per-session registry, not app state","tier":"internal","area":"Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246\/e\/hooks-are-looked-up-through-a-per-session-registry-not-app-s","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246","markdown":"### Hooks are looked up through a per-session registry, not app state\n\nHooks are looked up per session rather than from global state; your hooks fire the same.\n\n**What**\n\nHook presence checks, SessionEnd dispatch, stop-prompt registration, the permission-request check and the StopFailure dispatcher all now query a per-session hook registry rather than reading hooks out of global app state. No change to how your configured hooks fire.\n\n**Details**\n\n- The hook runner takes a `sessionHooks` argument with a `has(id, event)` lookup.\n- Tool aliases used for matcher filtering come from an optional `getToolAliases()` callback instead of the tool permission context.\n- Teammate setup registers its Stop hook via `addFunctionHook` rather than a global registration helper.\n- A React error was added for using the registry hook outside its provider.\n\n**Evidence**\n\n`useSessionHooksRegistry cannot be called outside of an <AppStateProvider \/>`, `hook_event_name: \"StopFailure\"`, `addFunctionHook`\n\n- Area: Hooks\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 2\/5"}