Put the Check Your Numbers Depend On in a Hook
A line in CLAUDE.md such as "rerun the scorer tests after editing metrics.py" is followed at some rate. You have not measured that rate, and measuring it would take dozens of sessions. Until you do, every number produced after an edit to the scorer carries an unknown chance that nobody checked it.
A hook removes that unknown. Anthropic's hook guide describes hooks as deterministic control: the action always happens rather than relying on the model to choose it. A PostToolUse hook with an Edit|Write matcher runs your script after every file edit. It fires after the tool ran, so it cannot undo the edit; exit code 2 shows your script's stderr to Claude, which is what you want for a failing test.
What to put behind it: a frozen score. Pick 20 to 50 items whose scores you verified by hand. Commit them with the exact aggregate the scorer must reproduce. The hook runs the scorer on that fixture and exits 2 on any difference. Test the script before any session depends on it:
echo '{"tool_name":"Edit","tool_input":{"file_path":"src/metrics.py"}}' | ./hooks/check-scorer.sh
echo $?Corrupt one fixture label and expect 2. Restore it and expect 0. This hook reports after the edit; it does not stop one. A PreToolUse guard that must stop an edit has its own ways to fail open, covered in making a hook prove its failure behavior.
A hook runs a weak check as reliably as a strong one. The fixture is where the judgment lives. When the frozen score moves, treat it as a result to explain before you touch the expected value; Chapter 16 covers why a scorer's output is a measurement with its own error.