hook
Use PROACTIVELY when you need to create, update, configure, or validate Claude hooks for various events and integrations
Best use case
hook is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Use PROACTIVELY when you need to create, update, configure, or validate Claude hooks for various events and integrations
Use PROACTIVELY when you need to create, update, configure, or validate Claude hooks for various events and integrations
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "hook" skill to help with this workflow task. Context: Use PROACTIVELY when you need to create, update, configure, or validate Claude hooks for various events and integrations
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hook/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hook Compares
| Feature / Agent | hook | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use PROACTIVELY when you need to create, update, configure, or validate Claude hooks for various events and integrations
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
## 1. Context - Main Objective: Create or update Claude Code hook scripts named $1 with requirements: $2 - Secondary Objective: Ensure hooks are properly linked in settings and follow security best practices - User Input: [$1 = hook name, $2 = hook requirements/description] ## 2. Workflow ### Phase 1: Discovery & Analysis [P0] - T001: Assess if you needed more context about hook specifications. If so, read `.claude/skills/hook/hooks.md` [P0] - T002: Check if hook already exists in `.claude/hooks/` directory [P0] - T003: Review `@.claude/settings.local.json` for existing hook configurations [P1] - T004: Identify appropriate Claude Code events to hook into [P1] - T005: Assess security and performance implications [P2] ### Phase 2: Implementation [P0] - T006: Create new hook script OR update existing hook script in `.claude/hooks/` [P0] - T007: Implement hook logic with proper error handling [P0] - T008: Add logging and debugging capabilities [P1] - T009: Create input validation and sanitization routines [P1] - T010: Document hook behavior in script comments [P2] ### Phase 3: Configuration [P1] - T011: Update `@.claude/settings.local.json` to link the hook [P0] - T012: Configure appropriate event triggers [P1] - T013: Set necessary permissions and access levels [P1] - T014: Ensure compatibility with existing hooks [P2] ### Phase 4: Validation [P1] - T015: Test hook execution without creating test files [P0] - T016: Verify error handling and edge cases [P1] - T017: Check for security vulnerabilities [P1] - T018: Validate performance impact [P2] - T019: Provide comprehensive report to main agent [P0] ## 3. Implementation Strategy - For new hooks: Create script file in `.claude/hooks/` following naming convention - For updates: Read existing hook, preserve working logic, apply requested changes - Use Python or Bash depending on complexity requirements - Implement idempotent operations where possible - Follow existing hook patterns in the codebase for consistency - Read `.claude/skills/hook-writer/hooks.md` for hook specifications PROACTIVELY ## 4. Constraints - **Must** update `@.claude/settings.local.json` to link hooks - **Must** test hooks after generation without creating test files - **Never** create hooks that modify critical system files - **Never** implement hooks with hardcoded credentials - **Never** write hooks that can cause infinite loops - **Never** bypass security validations or access controls - **Never** create hooks without proper error handling - **Never** create test files when testing hooks ## 5. Success Criteria - Hook script exists and is syntactically valid - Hook is properly linked in `settings.local.json` - Hook executes successfully on target event - Error handling covers common failure scenarios - No security vulnerabilities detected - Comprehensive report provided to main agent upon completion
Related Skills
hooks-management
Use PROACTIVELY when you need to create, update, configure, or validate Claude hooks for various events and integrations
hooks-automation
Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows.
webhook-tester
Test webhook integrations locally with tunneling, inspection, and debugging tools.
building-hooks
Expert at creating and modifying Claude Code event hooks for automation and policy enforcement. Auto-invokes when the user wants to create, update, modify, enhance, validate, or standardize hooks, or when modifying hooks.json configuration, needs help with event-driven automation, or wants to understand hook patterns. Also auto-invokes proactively when Claude is about to write hooks.json files, or implement tasks that involve creating event hook configurations.
writing-hookify-rules
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
hook-development
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
creating-claude-hooks
Use when creating or publishing Claude Code hooks - covers executable format, event types, JSON I/O, exit codes, security requirements, and PRPM package structure
claude-hooks
Claude Code hooks configuration specialist. Use when creating hooks for tool validation, logging, notifications, or custom automation in Claude Code.
claude-code-hooks
Claude Code hook system for pre/post tool execution. Triggers on: hooks, PreToolUse, PostToolUse, hook script, tool validation, audit logging.
creating-hooks
Creates Claude Code hooks for automation and workflow customization. Guides through hook events, configuration, and script creation. Use when user wants to create a hook, automate Claude Code, or asks about hook events.
azure-quotas
Check/manage Azure quotas and usage across providers. For deployment planning, capacity validation, region selection. WHEN: "check quotas", "service limits", "current usage", "request quota increase", "quota exceeded", "validate capacity", "regional availability", "provisioning limits", "vCPU limit", "how many vCPUs available in my subscription".
raindrop-io
Manage Raindrop.io bookmarks with AI assistance. Save and organize bookmarks, search your collection, manage reading lists, and organize research materials. Use when working with bookmarks, web research, reading lists, or when user mentions Raindrop.io.