Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.0.36 Home All releases olderv2.0.35 v2.0.37newer
Claude Code v2.0.36

Session Hooks Infrastructure

What: New architecture for temporary, session-scoped hooks that automatically clean up when sessions end How it works:

  • Session hooks are stored separately from user settings (sessionHooks field in app state at line 141240)
  • Automatically cleared on session end to prevent accumulation
  • Support callback functions (onMatch) for programmatic responses
  • Cannot be removed through settings UI (protected at diff lines 2057-2059)

Details:

  • Three new management functions:
  • wB1() at line 457341 - Retrieves session hooks for a specific session
  • ll2() at line 457356 - Finds and returns matching hook callbacks
  • il2() at line 457367 - Clears all hooks for a session
  • Session hooks are merged with permanent hooks at execution time (merge logic in nl2() at line 457391)
  • Hooks are marked with source: "sessionHook" to distinguish from settings-based hooks
  • Designed for plugins, agents, and temporary automation without polluting user settings
  • Evidence: State initialization at line 141240, management functions at lines 457341-457367, integration in nl2() at lines 457391-457413

See this entry in the whole of v2.0.36 →