AI GLOSSARY
Claude Code Hooks
Hooks turn important agent lifecycle events into programmable control points.
Simple explanation
Hooks run at defined lifecycle points such as before tool use, after tool use, on failures, around compaction, or when sessions and subagents change state. They are useful for policy enforcement, formatting, testing, logging, and automated feedback.
Technical explanation
Hooks run at defined lifecycle points such as before tool use, after tool use, on failures, around compaction, or when sessions and subagents change state. They are useful for policy enforcement, formatting, testing, logging, and automated feedback.
Example
Trace how Agent event becomes Controlled behavior through hook logic.