skills/0xdarkmatter/claude-code-hooks/SKILL.md
Claude Code hook system for pre/post tool execution. Triggers on: hooks, PreToolUse, PostToolUse, hook script, tool validation, audit logging.
npx skillsauth add aiskillstore/marketplace claude-code-hooksInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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
}]
}]
}
}
| Pattern | Matches |
|---------|---------|
| "Write" | Only Write tool |
| "*" or "" | All tools |
| "mcp__*" | All MCP tools |
| "Bash" | Bash commands |
#!/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
| 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 |
"$VAR" not $VAR.. traversal)$CLAUDE_PROJECT_DIR for paths# Debug hook loading
claude --debug
# List registered hooks
/hooks
# Test script manually
echo '{"tool_name":"Bash"}' | ./hooks/validate.sh
./references/hook-events.md - All events with input/output schemas./references/configuration.md - Advanced config patterns./references/security-patterns.md - Production securitySee Also: claude-code-debug for troubleshooting, claude-code-headless for CLI automation
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.