CC-HK-021: Invalid If Field - Claude Hooks
Summary
- Rule ID:
CC-HK-021 - Severity:
MEDIUM - Category:
Claude Hooks - Normative Level:
MUST - Auto-Fix:
No - Verified On:
2026-03-28
Applicability
- Tool:
claude-code - Version Range:
unspecified - Spec Revision:
unspecified
Evidence Sources
Test Coverage Metadata
- Unit tests:
true - Fixture tests:
false - E2E tests:
false
Examples
The following examples demonstrate what triggers this rule and how to fix it.
Invalid
{ "type": "command", "command": "npm test", "if": "" }
Valid
{ "type": "command", "command": "npm test", "if": "tool_name == 'Bash'" }