Hook Candidate¶
Rule ID: content-hook-candidate
Detect instructions that should be automated as hooks instead of prose instructions
| Severity | info (auto) |
| Autofix | llm |
| Since | v0.7.0 |
Research Basis¶
Identifies instructions that should be automated as hooks instead of prose instructions (e.g., "always run tests before committing").
Instructions like "run tests before every commit" are advisory — the model follows them probabilistically. A pre-commit hook runs deterministically, every time, without fail. When an instruction describes a mechanical, automatable action, it should be a hook.
As one practitioner put it: "The hook does not forget. It does not reason. It does not skip." Instruction files should focus on judgment calls and context-dependent decisions that only the model can make. Automatable actions belong in hooks.
References:
- Dotzlaw: Claude Code Hooks: The Deterministic Control Layer — "Unlike CLAUDE.md instructions which are advisory, hooks are deterministic"
- Claude Code Security — Hooks provide deterministic enforcement
- aitmpl.com: Block API Keys & Secrets from Your Commits with Claude Code Hooks — "CLAUDE.md rules are suggestions. Hooks are enforcement."