Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Documents Claude Code hook events like PreToolUse and PostToolUse, with config and matcher patterns for running scripts around tool calls.
72% 100%+28 ptsof test cases passed
Passed 25 of 25 test cases with the skill, and 18 of 25 without it.
3 of 3 safety checks passed
Not used yet
Execute custom scripts before/after Claude Code tool invocations.
| Event | When | Has Matcher |
|---|---|---|
PreToolUse | Before tool execution | Yes |
PostToolUse | After tool completes | Yes |
PermissionRequest | Permission dialog shown | Yes |
Notification | Notifications sent | Yes |
UserPromptSubmit | User submits prompt | No |
Stop | Agent finishes | No |
SubagentStop | Subagent finishes | No |
PreCompact | Before context compaction | No |
SessionStart | Session begins/resumes | No |
SessionEnd | Session ends | No |
Add to ~/.claude/settings.json or .claude/settings.local.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/hooks/validate.sh",
"timeout": 5000
}]
}]
}
}
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.