CC-HK-029: Invalid or Ineffective onFailure - Claude Hooks
Summary
- Rule ID:
CC-HK-029 - Severity:
MEDIUM - Category:
Claude Hooks - Normative Level:
MUST - Auto-Fix:
No - Verified On:
2026-10-17
Applicability
- Tool:
claude-code - Version Range:
>=2.1.295 - Spec Revision:
unspecified
Evidence Sources
Test Coverage Metadata
- Unit tests:
true - Fixture tests:
true - E2E tests:
false
Examples
The following examples demonstrate what triggers this rule and how to fix it.
Invalid
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "check.sh",
"onFailure": "deny"
}
]
}
]
}
}
Valid
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "node",
"args": [
"check.js"
],
"onFailure": "block"
}
]
}
]
}
}