MCPcopy
hub / github.com/codeaashu/claude-code / executeInstructionsLoadedHooks

Function executeInstructionsLoadedHooks

src/utils/hooks.ts:4335–4369  ·  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

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