MCPcopy Index your code
hub / github.com/codeaashu/claude-code / addSessionHook

Function addSessionHook

src/utils/hooks/sessionHooks.ts:68–86  ·  view source on GitHub ↗
(
  setAppState: (updater: (prev: AppState) => AppState) => void,
  sessionId: string,
  event: HookEvent,
  matcher: string,
  hook: HookCommand,
  onHookSuccess?: OnHookSuccess,
  skillRoot?: string,
)

Source from the content-addressed store, hash-verified

66 * Session hooks are temporary, in-memory only, and cleared when session ends.
67 */
68export function addSessionHook(
69 setAppState: (updater: (prev: AppState) => AppState) => void,
70 sessionId: string,
71 event: HookEvent,
72 matcher: string,
73 hook: HookCommand,
74 onHookSuccess?: OnHookSuccess,
75 skillRoot?: string,
76): void {
77 addHookToSession(
78 setAppState,
79 sessionId,
80 event,
81 matcher,
82 hook,
83 onHookSuccess,
84 skillRoot,
85 )
86}
87
88/**
89 * Add a function hook to the session.

Callers 2

registerSkillHooksFunction · 0.85
registerFrontmatterHooksFunction · 0.85

Calls 1

addHookToSessionFunction · 0.85

Tested by

no test coverage detected