{"version":"2.0.36","anchor":"session-hooks-infrastructure","canonical_anchor":"session-hooks-infrastructure","heading":"Session Hooks Infrastructure","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.0.36\/e\/session-hooks-infrastructure","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.0.36","markdown":"### Session Hooks Infrastructure\n\n**What:** New architecture for temporary, session-scoped hooks that automatically clean up when sessions end **How it works:**\n\n- Session hooks are stored separately from user settings (`sessionHooks` field in app state at line 141240)\n- Automatically cleared on session end to prevent accumulation\n- Support callback functions (`onMatch`) for programmatic responses\n- Cannot be removed through settings UI (protected at diff lines 2057-2059)\n\n**Details:**\n\n- Three new management functions:\n- `wB1() at line 457341` - Retrieves session hooks for a specific session\n- `ll2() at line 457356` - Finds and returns matching hook callbacks\n- `il2() at line 457367` - Clears all hooks for a session\n- Session hooks are merged with permanent hooks at execution time (merge logic in `nl2() at line 457391`)\n- Hooks are marked with `source: \"sessionHook\"` to distinguish from settings-based hooks\n- Designed for plugins, agents, and temporary automation without polluting user settings\n- **Evidence**: State initialization at `line 141240`, management functions at `lines 457341-457367`, integration in `nl2() at lines 457391-457413`"}