Hook Development Rules When working with files in : Pattern Shell wrapper (.sh) → TypeScript (.ts) via Shell Wrapper Template TypeScript Handler Pattern Hook Events - PreToolUse - Before tool execution (can block) - PostToolUse - After tool execution - UserPromptSubmit - Before processing user prompt - PreCompact - Before context compaction - SessionStart - On session start/resume/compact - Stop - When agent finishes Testing Test hooks manually: Registration Add hooks to : ---