Skip to content

Put Repeatable Checks in Command Hooks

2026-07-31claude-code, verification

Your acceptance criteria say the linter must run after an edit. Putting that sentence in the agent's instructions still leaves execution to the model.

A command hook attaches a script to a defined workflow event. Test that the intended event triggers it, that the check catches a known failure, and that the failure is reported or blocks the action as intended.

You can ask the agent to draft the hook. You still own the check: a script that runs reliably can be reliably wrong.

Keep judgment in instructions. Put repeatable checks at explicit workflow boundaries. Anthropic's hook guide explains the event and failure behavior to verify.