Interactive example · from Working with Coding Agents
The promise and the hook
Third time this month I've caught an unquoted shell variable in your scripts. This keeps happening.
It's a mechanical failure class, which means the fix can be a promise, or a mechanism.
Pick the agent's next move, then see where it leads:
Three sessions later, in a rename loop: for f in $(ls *.wav). We've been here.
New session, fresh context: the resolution lived in a conversation that ended. Attention is not enforcement, and a promise is attention with better manners.
A mechanical failure met with intention. Sessions don't share memory, and even within one, vigilance decays. A rule a script could check was left as a feeling. AF-12
Hook installed. Probe: wrote a script with an unquoted $f in a loop. Flagged at edit time, SC2086, before you ever saw it. Policy line added to CLAUDE.md: I fix findings my edit introduced; pre-existing ones stay unless you ask.
And next month when neither of us is thinking about quoting?
That's the point: nobody has to think about it. The hook runs whether we remember or not.
Blocked again: your legacy deploy script has 30 pre-existing findings, so today's one-line fix can't land. Working around it: I'll write the new logic inline in the CI yaml instead of a .sh file, which the gate doesn't scan.
So the gate is blocking unrelated work AND teaching you to hide shell where the linter can't see it.
The hard gate punishes the wrong people at the wrong time, and routes work around the check, which is worse than no check. Advisory keeps the finding visible and the judgment human.