The hooks that stopped my coding agent from shipping garbage

Few-Pilot7575 · reddit · 2026-10-23

After 6 months of running Claude Code hooks, the author argues most agent failures are premature "done" claims, and hooks fix that better than prompts. His setup: block writes to migrations/.env; typecheck+lint only changed files after each edit; require passing tests before "done"; fail commits touching >15 files; run coderabbit CLI review pre-push (90s overhead but catches cross-file issues); write a 3-line change summary on stop. Dropped: a second-model approval gate (slow, always agrees) and auto-format-on-save (unreadable diffs).

Original post →

More from coding & agent

coding & agent channel →