Claude Code hooks guide: all 33 lifecycle events, exit code 2 blocking, PreToolUse examples, the stop_hook_active trap, and the patterns worth shipping.