Agent hooks

Commands an agent runs automatically at fixed points in its loop, such as before a tool call or when a session ends.

Updated November 23, 2026

Hooks turn a rule into a guarantee: run the formatter after every edit, block writes to a protected folder, send a notification when the agent finishes. Claude Code, Codex and Hermes Agent support hooks, each with its own configuration.

Because hooks run commands, agents ask before trusting new ones; Codex and Hermes have flags that skip that check for a run.