Agent skill · software engineering · aiskillstore

claude-code-hooks

Claude Code hook system for pre/post tool execution. Triggers on: hooks, PreToolUse, PostToolUse, hook script, tool validation, audit logging.

Why this skill is useful

Adds custom hook scripts for pre/post tool execution that enhance the capabilities of the Claude Code CLI.

What it needs

Requires bash installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

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: Matcher Patterns Pattern Matches --------- --------- "Write" Only Write tool "" or "" All tools "mcp" All MCP tools "Bash" Bash commands Hook Script Requirements 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 $CLAUDEPROJECTDIR for paths [ ] Set reasonable timeouts [ ] Handle jq parsing errors Troubleshooting 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

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/claude-code-hooks

View the source on GitHub

Browse the @skills marketplace