hooks-builder

Create event-driven hooks for Claude Code automation.

37|4|Updated Dec 6, 2025
One-click install
npx skills add https://github.com/mike-coulbourn/claude-vibes --skill hooks-builder-mike-coulbourn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hooks-builder
Source: https://github.com/mike-coulbourn/claude-vibes/tree/main/plugins/vibes/skills/hooks-builder
Command: npx skills add https://github.com/mike-coulbourn/claude-vibes --skill hooks-builder-mike-coulbourn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill empowers users to implement powerful, event-driven automation within Claude Code, enabling custom security policies, code quality enforcement, and workflow orchestration. It demystifies hook creation, allowing users to control and extend Claude's behavior.

Core Features & Use Cases

  • Event-Driven Automation: Understand and implement hooks for events like PreToolUse, PostToolUse, SessionStart, and UserPromptSubmit.
  • Security & Validation: Create hooks to block dangerous operations, validate user inputs, or enforce coding standards.
  • Workflow Orchestration: Automate tasks like environment setup, code formatting on save, or logging all tool usage.
  • Use Case: You want to prevent Claude from accidentally modifying sensitive .env files. This skill guides you to create a PreToolUse hook that intercepts Write or Edit operations, checks the file path, and blocks any attempt to modify .env files, ensuring critical configurations remain safe.

Quick Start

Ask the hooks-builder to help you create a hook to prevent Claude from writing to .env files.

Frequently Asked Questions about hooks-builder

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

FAQPage Schema
How do I create event-driven hooks to automate Claude Code workflows?

Event-driven hooks intercept Claude Code operations at key moments—PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, and others—letting you run validation scripts, enforce policies, or orchestrate tasks. Create a hook by defining the event, matcher syntax for target operations, and inline or external scripts that return exit code 0 to allow or 2 to block.

Can I use hooks to prevent Claude from modifying sensitive files like .env?

Yes. A PreToolUse hook intercepts Write and Edit operations, checks file paths against a matcher pattern, and blocks attempts to modify .env files by returning exit code 2, protecting critical configurations from accidental changes.

What hook events are available for automation in Claude Code?

Ten hook events cover the full lifecycle: PreToolUse and PostToolUse for tool operations, UserPromptSubmit for input validation, SessionStart and SessionEnd for setup and cleanup, PermissionRequest for access control, Stop and SubagentStop for workflow interruption, Notification for alerts, and PreCompact for context management.

How do I enforce code quality standards automatically with hooks?

Create PostToolUse hooks that run after code edits or formatting operations, triggering external validation scripts—linters, formatters, or custom checkers—and block commits or saves if standards aren't met by returning exit code 2 with error details.

Do hooks support both inline scripts and external command execution?

Yes. Hooks accept inline scripts or command-based execution, JSON input/output contracts for data passing, environment variables for context injection, and robust error handling with debugging guidance for troubleshooting failures.

What security policies can I enforce with hooks across development tasks?

Hooks enable custom security policies like blocking dangerous tool use, validating user inputs before execution, enforcing coding standards on file writes, logging all operations for audit trails, and orchestrating environment-specific workflows across code editing, testing, and formatting tasks.