Anurag Singh writes about using a Stop hook in Claude Code to force the agent to review its work against a checklist of previously made mistakes before finishing, solving the problem of the model repeating the same errors across sessions despite CLAUDE.md instructions and prompt-level guidance.
- The hook is a Bash script that uses jq to read a mistakes.md file and inject a "block" decision, sending Claude back for a second review pass.
- The script checks the stop_hook_active flag to avoid an infinite review loop.
- A TaskCompleted event hook is a more token-efficient alternative if you only want review on task completion rather than every response.
- Hooks execute deterministically on trigger events, unlike textual instructions in CLAUDE.md which Claude may treat as optional.