What is Hooks (Claude Code Hooks)?
Automation rules that fire before or after Claude Code takes specific actions.
Detailed Explanation
Hooks are event-driven automation rules in Claude Code that execute commands or inject prompts when specific triggers occur. They fire on events like file saves, tool use, session start, and task execution. Hooks enable automated workflows like running linters on save, enforcing code review before commits, or injecting context before specific operations. They are defined as JSON files in .claude/hooks/ (or .kiro/hooks/ in Kiro) and support both command actions (shell scripts) and agent actions (prompt injection).