Stop Hooks & Post-Turn Pipeline
What happens after the AI finishes a response.
Overview
query/stopHooks.ts runs after every AI turn completes. It's the post-turn pipeline that triggers background tasks, checks for hook conditions, and decides whether to continue.
Hook Types
Stop Hooks
Run when the model stops (no more tool_use blocks):
TypeScript