Full glossary

Glossary

Hook

Also: hook · PreToolUse · PostToolUse

A handler that fires at a fixed point in the agent's loop: before a tool call, after a file edit, at the end of a turn. Unlike instructions, it always runs.

Example

A PostToolUse hook matching Edit|Write runs prettier after every edit; a PreToolUse hook exiting with code 2 blocks the call.

Where it shows up

Related terms

Source