What is a hook?

A hook is something that runs automatically on an event, whether or not the agent decides to.

Navid Moazzezby Navid MoazzezUpdated Sept. 12, 20261 min read
~/ai-glossary
$ glossary
4 of 7 in #what-it-runs

It fires on things like before a command runs, after a file is edited, or when a session ends.

The difference from an instruction matters. An instruction asks the model to behave a certain way and it usually complies. A hook does not ask. If something must happen every time, it is a hook.

Was this page helpful?