# Hook

A command that an AI coding agent runs automatically at a set point in its work.

The term is Claude Code's, and other agent tools use it for the same idea with their own details. A hook is the opposite of a [tool call](/reference/glossary/tool-call): the model decides on a tool call, but a hook happens every time its trigger does. Use one for a rule that must hold, such as checking a file after every edit. Advice you want the agent to remember goes in [agent memory](/reference/glossary/agent-memory) instead.

---

Published 2026-11-06. Web page: https://www.mackenziebowes.com/reference/glossary/hook
