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

Function executeInstructionsLoadedHooks

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

4428 * attachments.ts)
4429 */
4430export async function executeInstructionsLoadedHooks(
4431 filePath: string,
4432 memoryType: InstructionsMemoryType,
4433 loadReason: InstructionsLoadReason,
4434 options?: {
4435 globs?: string[]
4436 triggerFilePath?: string
4437 parentFilePath?: string
4438 timeoutMs?: number
4439 },
4440): Promise<void> {
4441 const {
4442 globs,
4443 triggerFilePath,
4444 parentFilePath,
4445 timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4446 } = options ?? {}
4447
4448 const hookInput: InstructionsLoadedHookInput = {
4449 ...createBaseHookInput(undefined),
4450 hook_event_name: 'InstructionsLoaded',
4451 file_path: filePath,
4452 memory_type: memoryType,
4453 load_reason: loadReason,
4454 globs,
4455 trigger_file_path: triggerFilePath,
4456 parent_file_path: parentFilePath,
4457 }
4458
4459 await executeHooksOutsideREPL({
4460 hookInput,
4461 timeoutMs,
4462 matchQuery: loadReason,
4463 })
4464}
4465
4466/** Result of an elicitation hook execution (non-REPL path). */
4467export 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