
Hook Development
If you're building Claude Code plugins and need to control what happens before and after tool execution, this is your starting point. It covers the five main hook types: PreToolUse for validating operations before they run, PostToolUse for reacting to results, Stop and SubagentStop for enforcing completion standards, and SessionStart for loading project context. The guide emphasizes prompt-based hooks over function-based ones, which makes sense since you get LLM-driven decision making instead of hard-coded logic. Originally from ovachiever/droid-tings, now maintained by davila7. Worth checking out if you're tired of Claude doing things you'd rather it asked about first.
- GitHub stars
- 30.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add davila7/claude-code-templates --skill 'Hook Development' --agent claude-codeInstalls into .claude/skills of the current project.
Files
Hook Development for Claude Code Plugins
Overview
Hooks are event-driven automation scripts that execute in response to Claude Code events. Use hooks to validate operations, enforce policies, add context, and integrate external tools into workflows.
Key capabilities:
- Validate tool calls before execution (PreToolUse)
- React to tool results (PostToolUse)
- Enforce completion standards (Stop, SubagentStop)
- Load project context (SessionStart)
- Automate workflows across the development lifecycle
Hook Types
Prompt-Based Hooks (Recommended)
Use LLM-driven decision making for context-aware validation:
{
"type": "prompt",
"prompt": "Evaluate if this tool use is appropriate: $TOOL_INPUT",
"timeout": 30
}
Supported events: Stop, SubagentStop, UserPromptSubmit, PreToolUse
Benefits:
- Context-aware decisions based on natural language reasoning
- Flexible evaluation logic without bash scripting
- Better edge case handling
- Easier to maintain and extend
Command Hooks
Execute bash commands for deterministic checks:
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh",
"timeout": 60
}
Sponsors
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Frontend Development, Backend & APIs, AI & Agent Building, Automation & Workflows
- First seen
- Jun 3, 2026
More from davila7/claude-code-templates
All 618- HTML Injection Testing
- IDOR Vulnerability Testing
- Linux Privilege Escalation
- Linux Production Shell Scripts
- MCP Integration
- Metasploit Framework
- Network 101
- PDF Processing
- PDF Processing Pro
- Pentest Checklist
- Pentest Commands
- Plugin Settings
- Plugin Structure
- Privilege Escalation Methods
- Red Team Tools And Methodology
- Security Scanning Tools
- SEO Optimizer
- Shodan Reconnaissance And Pentesting
- Skill Development
- SMTP Penetration Testing
- SQL Injection Testing
- SQLMap Database Penetration Testing
- SSH Penetration Testing
- Top 100 Web Vulnerabilities Reference