How to make Claude Code run tests: hooks against agent forgetfulness
The author suggests moving critical rules from Claude Code's context window into code via lifecycle hooks. Three gates are described: blocking a commit without a fresh green run, tracking test edits, and forbidding ending a turn with untested changes. In a direct experiment, the hook beat the user instruction 'don't run tests'.
Anthropic
Moonshot AI

