MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / executeInstructionsLoadedHooks

Function executeInstructionsLoadedHooks

source code/utils/hooks.ts:4337–4371  ·  view source on GitHub ↗
(
  filePath: string,
  memoryType: InstructionsMemoryType,
  loadReason: InstructionsLoadReason,
  options?: {
    globs?: string[]
    triggerFilePath?: string
    parentFilePath?: string
    timeoutMs?: number
  },
)

Source from the content-addressed store, hash-verified

4335 * attachments.ts)
4336 */
4337export async function executeInstructionsLoadedHooks(
4338 filePath: string,
4339 memoryType: InstructionsMemoryType,
4340 loadReason: InstructionsLoadReason,
4341 options?: {
4342 globs?: string[]
4343 triggerFilePath?: string
4344 parentFilePath?: string
4345 timeoutMs?: number
4346 },
4347): Promise<void> {
4348 const {
4349 globs,
4350 triggerFilePath,
4351 parentFilePath,
4352 timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4353 } = options ?? {}
4354
4355 const hookInput: InstructionsLoadedHookInput = {
4356 ...createBaseHookInput(undefined),
4357 hook_event_name: 'InstructionsLoaded',
4358 file_path: filePath,
4359 memory_type: memoryType,
4360 load_reason: loadReason,
4361 globs,
4362 trigger_file_path: triggerFilePath,
4363 parent_file_path: parentFilePath,
4364 }
4365
4366 await executeHooksOutsideREPL({
4367 hookInput,
4368 timeoutMs,
4369 matchQuery: loadReason,
4370 })
4371}
4372
4373/** Result of an elicitation hook execution (non-REPL path). */
4374export type ElicitationHookResult = {

Callers 2

memoryFilesToAttachmentsFunction · 0.85
claudemd.tsFile · 0.85

Calls 2

createBaseHookInputFunction · 0.85
executeHooksOutsideREPLFunction · 0.85

Tested by

no test coverage detected