<essential principles Hooks are event-driven automation for Claude Code that execute shell commands, LLM prompts, or multi-turn agents in response to tool usage, session events, and user interactions. They provide deterministic control over Claude's behavior without modifying core code. 1. Three Hook Types: - command — shell command, deterministic, fast. Exit 0 = proceed, exit 2 = block. JSON stdout for structured control. - prompt — single-turn LLM evaluation (Haiku default). Returns or . - agent — multi-turn subagent with tool access (up to 50 turns). Same ok/reason output. Use when verific…