# 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.

## Keep reading

- [Agent harness](https://envhaven.com/glossary/agent-harness)
- [Permission prompt](https://envhaven.com/glossary/permission-prompt)
- [Slash command](https://envhaven.com/glossary/slash-command)

Source: https://envhaven.com/glossary/agent-hooks
