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

Function executeConfigChangeHooks

src/utils/hooks.ts:4373–4398  ·  view source on GitHub ↗
(
  source: ConfigChangeSource,
  filePath?: string,
  timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
)

Source from the content-addressed store, hash-verified

4371 * @param timeoutMs Optional timeout in milliseconds for hook execution
4372 */
4373export async function executeConfigChangeHooks(
4374 source: ConfigChangeSource,
4375 filePath?: string,
4376 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4377): Promise<HookOutsideReplResult[]> {
4378 const hookInput: ConfigChangeHookInput = {
4379 ...createBaseHookInput(undefined),
4380 hook_event_name: 'ConfigChange',
4381 source,
4382 file_path: filePath,
4383 }
4384
4385 const results = await executeHooksOutsideREPL({
4386 hookInput,
4387 timeoutMs,
4388 matchQuery: source,
4389 })
4390
4391 // Policy settings are enterprise-managed — hooks fire for audit logging
4392 // but must never block policy changes from being applied
4393 if (source === 'policy_settings') {
4394 return results.map(r => ({ ...r, blocked: false }))
4395 }
4396
4397 return results
4398}
4399
4400async function executeEnvHooks(
4401 hookInput: HookInput,

Callers 3

handleChangeFunction · 0.85
handleDeleteFunction · 0.85
scheduleReloadFunction · 0.85

Calls 2

createBaseHookInputFunction · 0.85
executeHooksOutsideREPLFunction · 0.85

Tested by

no test coverage detected