claude-code-hooks
Claude Code hook system for pre/post tool execution. Triggers on: hooks, PreToolUse, PostToolUse, hook script, tool validation, audit logging.
Install / Use
npx skills add aiskillstore/marketplace --skill claude-code-hooksInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Customer SupportSupported Platforms
Tags
Our assessment of claude-code-hooks
claude-code-hooks scores 85/100 on our quality scale, 243rd of 317 Customer Support skills we index.
Its SKILL.md is 2.9 KB long, well organised into 18 sections with 3 code examples: a solid amount of guidance for an agent.
It has 428 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so claude-code-hooks is actively maintained.
- Our last check on 2026-11-05 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-07. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
claude-code-hooks compared with similar skills
All 4 of these similar skills score higher than claude-code-hooks; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| claude-code-hooks (this skill)by aiskillstore | 85 | 428 | 55d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 57d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 57d ago | SKILL.md |
| prospectingby coreyhaines31 | 100 | 60.1k | 7d ago | SKILL.md |
| ad-creativeby coreyhaines31 | 100 | 60.1k | 7d ago | SKILL.md |
Frequently asked questions
- How do I install claude-code-hooks?
- Run
npx skills add aiskillstore/marketplace --skill claude-code-hooks. The install tabs above show the steps for each supported agent. - Which AI agents does claude-code-hooks work with?
- It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is claude-code-hooks safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is claude-code-hooks still maintained?
- The repository was last updated about 2 months ago, so claude-code-hooks is actively maintained.
Skill content
View source on GitHubname: claude-code-hooks description: "Claude Code hook system for pre/post tool execution. Triggers on: hooks, PreToolUse, PostToolUse, hook script, tool validation, audit logging." compatibility: "Claude Code CLI with settings.json support" allowed-tools: "Bash Read Write" depends-on: [] related-skills: [claude-code-debug, claude-code-headless]
Claude Code Hooks
Execute custom scripts before/after Claude Code tool invocations.
Quick Reference
| 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 |
Basic Configuration
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
}]
}]
}
}
Matcher Patterns
| Pattern | Matches |
|---------|---------|
| "Write" | Only Write tool |
| "*" or "" | All tools |
| "mcp__*" | All MCP tools |
| "Bash" | Bash commands |
Hook Script Requirements
#!/bin/bash
# Receives JSON via stdin: { "tool_name": "...", "tool_input": {...} }
INPUT=$(cat)
TOOL=$(echo "$INPUT" | jq -r '.tool_name')
# Exit codes:
# 0 = Success (continue)
# 2 = Block with error (stderr shown to Claude)
# Other = Non-blocking error
Common Use Cases
| Use Case | Event | Example | |----------|-------|---------| | Validate inputs | PreToolUse | Block dangerous commands | | Audit logging | PostToolUse | Log all tool usage | | Custom approval | PermissionRequest | Slack notification | | Session init | SessionStart | Load project context |
Security Checklist
- [ ] Quote all variables:
"$VAR"not$VAR - [ ] Validate paths (no
..traversal) - [ ] Use
$CLAUDE_PROJECT_DIRfor paths - [ ] Set reasonable timeouts
- [ ] Handle jq parsing errors
Troubleshooting
# Debug hook loading
claude --debug
# List registered hooks
/hooks
# Test script manually
echo '{"tool_name":"Bash"}' | ./hooks/validate.sh
Official Documentation
- https://code.claude.com/docs/en/hooks - Hooks reference
- https://code.claude.com/docs/en/settings - Settings configuration
Additional Resources
./references/hook-events.md- All events with input/output schemas./references/configuration.md- Advanced config patterns./references/security-patterns.md- Production security
See Also: claude-code-debug for troubleshooting, claude-code-headless for CLI automation
Related Skills
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
prospecting
60.1kWhen the user wants to find and qualify prospects for outbound, or asks who to target first, which signal to prioritize, or where to spot buyers with the problem: buying signals, enrichment, verification, account research.
ad-creative
60.1kWhen the user wants to write or judge ad creative, or asks which ad, hook, or angle to run or kill: headlines, primary text, and variations for Google, Meta, LinkedIn, and TikTok, fresh angles when creative fatigues. Test hypotheses name the metric, comparison, and expected direction.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
