For three weeks straight, I kept asking my AI assistant to follow the same rule at the start of every session, and for three weeks straight it would forget by message twenty. I’d type the correction, it would apologize, and then the next day we’d do the whole dance again. It wasn’t malicious — it was just how prompting works. A prompt is a request, not a constraint, and requests get lost in the noise of a long conversation.

The turning point was realizing I was solving a systems problem with a conversational tool. I didn’t need to ask more clearly or more often. I needed something that ran automatically, outside the conversation, every single time — before the assistant could even consider skipping it. That’s what a hook is: not a nicer prompt, but a small piece of code the tool itself is required to execute.

“If you’ve asked the AI to do the same thing three times, make it a skill.”

What a hook actually is

A hook is a command that the tool runs automatically at a specific moment — before a tool call, after a response, at session start — regardless of what’s in the conversation. It doesn’t rely on the model remembering anything, because it isn’t the model doing the remembering. It’s the harness. Once a rule lives in a hook, it stops being something I hope gets followed and becomes something that simply happens.

{
  "hooks": {
    "PreToolUse": [
      { "matcher": "Bash", "command": "./check-rules.sh" }
    ]
  }
}
Screenshot placeholder
The hook that ended the arguments.

Since setting that up, I haven’t had to repeat myself once. The rule isn’t a suggestion sitting somewhere in a long system prompt anymore — it’s enforced the same way a lint rule is enforced, quietly and every time. The lesson generalizes past this one tool: if you find yourself typing the same correction more than twice, that’s the system telling you it’s time to stop asking and start requiring.