My autonomous setup earns its keep precisely because Claude Code starts on its own and finishes on its own. The thing that nearly broke that setup was Claude Code itself.

Why This Mechanism Matters

The biggest time sink for me over the past six months wasn't code quality or billing costs. It was a structural problem: notifications that wouldn't stop firing at a screen with no human in front of it.

Claude Code lets you register hooks in ~/.claude/settings.json. The Stop event fires every time Claude finishes a turn. I've planted an audit nag there called ~/.claude/hooks/self_audit_stop.sh. On any turn where Claude modified a file, the script checks "did you actually do an adversarial self-audit?" and blocks with exit 2 if it was skipped.

This works perfectly in interactive sessions. If Claude ships an implementation and forgets to write the audit, it gets blocked on the spot and "⚠️ セルフ監査未実施。" appears on screen. I see that and realize my verification was sloppy.