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

Function executeInstructionsLoadedHooks

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

4492 * attachments.ts)
4493 */
4494export async function executeInstructionsLoadedHooks(
4495 filePath: string,
4496 memoryType: InstructionsMemoryType,
4497 loadReason: InstructionsLoadReason,
4498 options?: {
4499 globs?: string[]
4500 triggerFilePath?: string
4501 parentFilePath?: string
4502 timeoutMs?: number
4503 },
4504): Promise<void> {
4505 const {
4506 globs,
4507 triggerFilePath,
4508 parentFilePath,
4509 timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4510 } = options ?? {}
4511
4512 const hookInput: InstructionsLoadedHookInput = {
4513 ...createBaseHookInput(undefined),
4514 hook_event_name: 'InstructionsLoaded',
4515 file_path: filePath,
4516 memory_type: memoryType,
4517 load_reason: loadReason,
4518 globs,
4519 trigger_file_path: triggerFilePath,
4520 parent_file_path: parentFilePath,
4521 }
4522
4523 await executeHooksOutsideREPL({
4524 hookInput,
4525 timeoutMs,
4526 matchQuery: loadReason,
4527 })
4528}
4529
4530/** Result of an elicitation hook execution (non-REPL path). */
4531export 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