A hook tells a system “when this happens, do that,” with nobody standing by to notice the moment. A session starts, a tool is about to run, a file changes, a commit happens, or an agent stops, and the hook runs a predefined action. This is automation with a specific trigger, common in Claude Code work, where agents repeat the same events. A workflow checklist depends on someone remembering the step; a hook attaches the rule to the moment itself.
The bell on a shop door is the everyday version. Nobody stands there all day asking “did someone walk in?” The door opens, the bell rings, and the right person looks up. The door opening is the event; the bell is the hook.
Why you care
Hooks make strong guardrails: before an agent sends an email, check that approval exists; before it deletes files, block the command; after a session, save a log. The obvious check happens every time, instead of only when someone remembers. Stay careful, though: a bad hook creates noise or fires the wrong action, so keep the event specific and the action safe.