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

Function executeConfigChangeHooks

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

Source from the content-addressed store, hash-verified

4307 * @param timeoutMs Optional timeout in milliseconds for hook execution
4308 */
4309export async function executeConfigChangeHooks(
4310 source: ConfigChangeSource,
4311 filePath?: string,
4312 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4313): Promise<HookOutsideReplResult[]> {
4314 const hookInput: ConfigChangeHookInput = {
4315 ...createBaseHookInput(undefined),
4316 hook_event_name: 'ConfigChange',
4317 source,
4318 file_path: filePath,
4319 }
4320
4321 const results = await executeHooksOutsideREPL({
4322 hookInput,
4323 timeoutMs,
4324 matchQuery: source,
4325 })
4326
4327 // Policy settings are enterprise-managed — hooks fire for audit logging
4328 // but must never block policy changes from being applied
4329 if (source === 'policy_settings') {
4330 return results.map(r => ({ ...r, blocked: false }))
4331 }
4332
4333 return results
4334}
4335
4336async function executeEnvHooks(
4337 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