Every correction I give my coding agent becomes a file, then a hook
It took me a good while to figure this out. When my programming agent makes an error and I point out the wrong part, the correction doesn't vanish inside the chat log. It's saved as a file. So the next session never trips over the same issue twice.
So far the agent has written 100 incident notes. It also keeps memory notes in the project, one fact for each file. Each time a session starts, a one-line index of those notes gets loaded. If the same mistake happens again, it becomes more than a mere memory. It becomes a hook. And that hook runs on every tool call and every reply, regardless of whether the agent remembers it. I currently have 63 hooks.
A few of those hooks came from pretty ordinary situations. After long sessions in another language, the agent started replying in English. According to the note, the more English documents it had read recently, the higher the chance it would drift. So now, whenever a reply comes out in English, one of the hooks forces a rewrite.
Another time it claimed something was fixed without ever testing it. That led to a rule: it must write down exactly how it checked. Dash usage also got restricted.
Has your agent ever repeated a fix you'd already applied? What do you do to prevent that from happening?
Replies
I do the first half of this. A correction goes into the project's notes the moment it is learned, one topic file per area, and the main file keeps only the rules that apply to every change. I haven't turned any into hooks yet. My question about 63 of them: how do you retire one? My notes are edited in place when a rule changes, with one line saying what it used to be and why. A note that is wrong is easy to spot when you read it, a hook that outlived its reason just keeps quietly blocking things.
An agent generated a report with a confident number nobody had measured. It took a day to find out it was a placeholder hardcoded into the component. Every metric now hooks directly to a test that fails if the calculation lacks a live data source.