ConfigChange API

July 14, 2026 ยท View on GitHub

Available when inheriting from ClaudeHooks::ConfigChange:

Runs when Claude Code configuration changes. Can block the change for most sources (note: policy_settings changes cannot be blocked).

Input Helpers

๐Ÿ“š Shared input helpers

MethodDescription
sourceThe source of the config change (e.g. 'project', 'user', 'policy_settings')
file_pathPath to the changed config file (optional)

Hook State Helpers

๐Ÿ“š Shared hook state methods

MethodDescription
block!(reason)Block the config change (ineffective for policy_settings)

Output Helpers

๐Ÿ“š Shared output helpers

MethodDescription
output.blocked?Check if the change was blocked
output.decisionGet the decision ('block' or nil)
output.reasonGet the block reason

Hook Exit Codes

Exit CodeBehavior
exit 0Config change proceeds
exit 2Blocks the change; STDERR shown to Claude