Claude Forgets My Rules After an Hour. A Hook Doesn't.
Working with an AI coding agent for a whole day is pretty normal these days. You set the rules in the morning, and by lunch it has built, tested and committed half a feature.
But the longer the session runs, the more of those morning rules quietly disappear. And the longer the answers get, the harder it is to find the one line that actually matters.
And here is what that actually looks like:

Nothing crashed. The rule just didn't survive the summary.
So I stopped asking Claude to remember how to end its answers. I made the harness check it instead.
The tool for that is a hook: a small script that Claude Code runs on its own at fixed moments, no matter what the model remembers. A Stop hook runs right after Claude finishes a reply. It can read that reply and send it back if something is missing.Mine checks three things. Every reply has to end with a Job report, an Executive summary and What I need from you. If one is missing, the reply goes back and Claude has to add it.
That matters because it turns a rule I'd have to repeat every few hours into one I set once.
Here is why, how it works, and the script to copy.