GitHub - disler/claude-code-hooks-mastery: Master Claude Code Hooks
2 months ago
- #automation
- #ai-agents
- #claude-code
- Claude Code Hooks provide deterministic control over Claude Code's behavior through lifecycle events.
- Hooks can intercept and modify user prompts, tool executions, and session events before Claude processes them.
- Key hooks include UserPromptSubmit for prompt validation, PreToolUse for security checks, and PostToolUse for logging.
- Hooks communicate via exit codes (0 for success, 2 for blocking errors) and structured JSON output.
- Claude Code Sub-Agents allow task delegation with specialized system prompts and tools, managed by a primary agent.
- The Meta-Agent is a sub-agent that generates new sub-agents, accelerating agent development.
- Team-Based Validation uses builder/validator agent pairs to ensure quality, with automated code validation hooks.
- Custom Output Styles transform Claude's responses into formats like HTML, YAML, or concise bullet points.
- Status Lines provide real-time terminal updates on session context, agent activity, and system metrics.
- The project uses UV single-file scripts for isolated, portable hook implementations with inline dependencies.