What problem does it solve?
Provides a structured, secure way to validate, modify, and react to Claude Code plugin events so agents cannot execute unsafe or inappropriate tools and so sessions load relevant context automatically.
Core Features & Use Cases
- Prompt-based and command hooks: Combine LLM-driven reasoning with deterministic shell checks for layered validation.
- Event coverage: Handles PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, and Notification events.
- Testing and validation utilities: Includes scripts to validate hooks.json, test hook scripts, and lint hook implementations for security and best practices.
- Security and performance guidance: Best practices for input validation, path safety, timeouts, parallel execution, and environment persistence using $CLAUDE_ENV_FILE and ${CLAUDE_PLUGIN_ROOT}.
Quick Start
Add a prompt-based PreToolUse hook that blocks destructive bash commands and validates writes to system or credential files before execution.