claude-hooks-developer

Create and manage Claude Code hooks with JSON configuration and script templates.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/paunchygent/docforge --skill claude-hooks-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-hooks-developer
Source: https://github.com/paunchygent/docforge/tree/main/frontend/.claude/skills/hooks
Command: npx skills add https://github.com/paunchygent/docforge --skill claude-hooks-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create Claude Code hooks to intercept tool calls, validate operations, and enhance workflows with security, validation, and notifications.

Core Capabilities

  • Hook Types: PreToolUse, PostToolUse, UserPromptSubmit, Stop, SessionStart, Notification
  • Hook Configuration: Generate JSON structures for settings.json and matchers
  • Script Templates: Provide Python/Bash templates for common hook patterns
  • Security Patterns: Implement file protection and command validation
  • Environment Variables: Use CLAUDE_PROJECT_DIR and tool inputs

Quick Start

Create a new hook in .claude/hooks, add configuration in .claude/settings.json, ensure the script is executable, and test hooks with relevant tool operations.

Frequently Asked Questions about claude-hooks-developer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create hooks to intercept and validate Claude Code tool calls?

Hooks intercept tool calls at specific lifecycle events like PreToolUse and PostToolUse, letting you validate operations before execution. Create a hook script in .claude/hooks, configure it in .claude/settings.json with event matchers, and use exit codes to approve or block actions.

What are PreToolUse and PostToolUse hooks, and when should I use each?

PreToolUse hooks run before a tool executes, letting you validate inputs and block unsafe commands. PostToolUse hooks run after execution to log results or trigger notifications. Use PreToolUse for security gates and PostToolUse for auditing and downstream actions.

How do I implement file protection and command validation in hooks?

File protection and command validation use hook scripts to inspect tool inputs against blocklists or rules. Extract tool parameters, match against patterns, and return decision objects with exit codes 0 (allow) or 1 (deny) to enforce security policies.

Can I use environment variables like CLAUDE_PROJECT_DIR inside hooks?

Yes. Hooks can access CLAUDE_PROJECT_DIR and tool input data to make context-aware decisions. Use these variables in Python or Bash scripts to reference project structure and dynamically apply validation rules.

What hook events are available beyond tool interception?

Beyond PreToolUse and PostToolUse, available events include UserPromptSubmit, Stop, SessionStart, Notification, and PermissionRequest. Each event lets you intercept different workflow stages for logging, validation, or notification routing.

Do I need special permissions to create and test hooks?

Make hook scripts executable in .claude/hooks and add configuration to .claude/settings.json. No special permissions are required; test by triggering relevant tool operations and verifying exit codes and decision objects match your intent.