Hooks around the agent loop
Swipe to change step
Step 1 of 8. A hook is your own code attached to a fixed point in the agent's lifecycle. It runs outside the model. Here SessionStart loads project facts as the session begins. SessionStart (load project facts), highlighted. Agent (model decides). PreToolUse (before the call). Bash (side effects happen here). PostToolUse (after the call). arrow from SessionStart to Agent. arrow from Agent to PreToolUse, labelled tool call. arrow from PreToolUse to Bash, labelled allowed. arrow from Bash to PostToolUse, labelled result. arrow from PostToolUse to Agent, labelled feedback. a facts moving along sm.
In this chapter
Chapter check
Already know this? Score 80% or more and you can skip ahead. Each attempt draws 4 questions from 12.
Loading check…