An animal-control intake agent keeps finishing its response before a mandatory checklist - microchip scan recorded, hold period set, owner notification queued - has been completed. The team wants completion to be gated automatically. What is the right mechanism?
Select an answer to reveal the explanation.
Short Explanation
The Stop hook is the bouncer at the exit. When the agent tries to wrap up, it can say not yet, microchip scan still missing, and force another turn.
Full Explanation
A definition of done stated in a prompt is advisory: an agent under context pressure can drift away from it and finish with items outstanding. Turning an intake checklist into a real gate requires a mechanism that fires at the moment of completion and is able to refuse it.
The Stop hook runs when the main agent is about to conclude its response and can block that conclusion, forcing another turn. Because the block carries feedback naming the unmet items—microchip scan, hold period, owner notification—the extra turn is productive rather than a blind retry, and the checklist becomes enforced by deterministic code instead of model discipline.
A PostToolUse hook fires after an individual tool call and has no notion of the agent trying to finish, so re-running the last tool addresses neither the checklist nor the premature ending; SessionStart can inject the checklist as standing context, which helps the model remember but cannot stop it concluding anyway; denying a final-response tool call with PreToolUse misdescribes the mechanics, since ending a turn is not a tool invocation there is anything to intercept.
Exam caveat: a Stop hook that blocks without a satisfiable exit condition can trap the agent in a loop, so pair the gate with a bounded retry count and an escalation path. Operational check: run an intake with one checklist item deliberately skipped and confirm the agent is forced into another turn whose feedback names that specific item.