adding-hooks

Configure event-driven hooks for Claude Code workflows.

1|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/kkhys/claude-code-marketplace --skill adding-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-hooks
Source: https://github.com/kkhys/claude-code-marketplace/tree/main/plugins/base/skills/adding-hooks
Command: npx skills add https://github.com/kkhys/claude-code-marketplace --skill adding-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Claude Code users often need to automate repetitive tool interactions and manage event-driven workflows. This skill provides a structured approach to configure, customize, and manage hooks that trigger actions before or after tool usage, helping teams enforce consistency and automation across projects.

Core Features & Use Cases

  • Define hook events (PreToolUse, PostToolUse, UserPromptSubmit, etc.) and their matching rules to flexibly control tool behavior.
  • Create command and prompt hooks with timeouts, and compose multi-step automation that integrates scripts and templates.
  • Use cases include automatic input validation, auditing/logging of tool usage, and enforcing safety constraints during tool execution.

Quick Start

Create a basic PreToolUse hook that validates input before a tool runs, then logs the event.

Frequently Asked Questions about adding-hooks

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

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

You can automate Claude Code workflows by configuring event-driven hooks to trigger actions before or after tool usage. This skill defines schemas and templates for PreToolUse, PostToolUse, UserPromptSubmit, and other lifecycle events to automate repetitive tool interactions.

What are PreToolUse and PostToolUse hooks used for in Claude Code?

PreToolUse and PostToolUse hooks are event-driven triggers used to validate input before a tool runs and log events afterward. They help enforce safety constraints, audit tool usage, and manage automated workflows across projects.

Can I set up matcher rules and timeouts for Claude Code command hooks?

Yes, you can configure command and prompt hooks with specific matcher rules and timeouts. This allows you to flexibly control tool behavior and compose multi-step automation that integrates scripts and templates.

How do I guide Claude's decisions using structured JSON outputs from hooks?

Hooks can produce structured JSON outputs to guide Claude's decisions during event-driven workflows. This structured data helps manage automation logic and enforce consistency across tool execution and prompt interactions.

Does configuring Claude Code hooks require any external dependencies?

No external dependencies are required to configure Claude Code hooks. This skill provides a self-contained approach with defined schemas and templates to manage event-driven workflows directly within your projects.

What's the best way to enforce safety constraints during Claude Code tool execution?

The best way to enforce safety constraints is by setting up event-driven hooks that validate input and manage permissions. Configuring PreToolUse and PermissionRequest hooks ensures consistent safety checks before tools execute.