It’s how you tell a system “when this happens, do that,” without anyone standing by to notice the moment.
Think about the bell on a shop door. 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. In software and agent work it’s the same: 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.
How it shows up
A startup hook is the easy one to picture (at the start of a session, update the repo), but it’s not the whole category. A hook can also be a guardrails tool: before an agent sends an email, check that approval exists; before it deletes files, block the command; after a session, save a log. This is automation with a trigger, not automation that runs randomly. In Claude Code work, agents move through repeated events, and a hook attaches rules to those moments. That’s different from a workflow checklist, which depends on someone remembering the step.
Why you care
You still have to be careful: a bad hook creates noise or fires the wrong action, so the event has to be specific and the action safe. A hook makes the obvious check happen every time, not just when someone remembers.