You have a working link checker. The agent runs it when you ask, but in a long session it often says "done" without running it. You want the check to run every time, with nobody remembering. What should you add?
Show answerHide answer
A hook is a command that your tool runs on a named event, without being asked. In Claude Code, a Stop hook runs when Claude finishes responding. If the hook exits with code 2, Claude Code prevents the stop and sends the hook's stderr text back to the agent, so it keeps working on the fix. The tool holds the rule, and no one has to remember it. Codex has Stop hooks too, and exit code 2 with a reason on stderr also makes Codex continue.