- Glossary
- Hook
Glossary term
Hook
Code that runs automatically at a lifecycle event, such as before or after a tool call, to check, block or log it.
Also called hooks.
Open lesson 44.3
PostToolUse: check or log a result · Chapter 44, and 3 more lessons below
In plain words
Hooks enforce rules deterministically, which prompts cannot guarantee.
Taught in
- 44.3PostToolUse: check or log a resultChapter 44, Hooks and the agent lifecycle · main lesson
- 44.1Lifecycle eventsChapter 44, Hooks and the agent lifecycle
- 44.2PreToolUse: block or modify a callChapter 44, Hooks and the agent lifecycle
- 44.4Hooks vs prompt instructionsChapter 44, Hooks and the agent lifecycle
Also in these lessons
Agent loopAttentionObservabilityPermission rulePostToolUse hook