hook-skill

Develop and configure Claude Code Hooks for lifecycle events like PreToolUse and PostToolUse.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/maxoreric/sop-engine --skill hook-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-skill
Source: https://github.com/maxoreric/sop-engine/tree/main/%24workflow.input.user_intent/skills/hook-skill
Command: npx skills add https://github.com/maxoreric/sop-engine --skill hook-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill empowers you to create, debug, and configure custom logic that runs automatically at specific points during Claude Code's execution, giving you fine-grained control over the AI's behavior.

Core Features & Use Cases

  • Event-Driven Logic: Execute custom scripts or prompts based on predefined events like PreToolUse, PostToolUse, SessionStart, or Stop.
  • Control & Validation: Intercept tool calls, validate inputs/outputs, automatically approve actions, or prevent unwanted operations.
  • Use Case: Automatically approve reading .md and .txt files, or prevent the execution of dangerous bash commands like rm -rf / by implementing PreToolUse hooks.

Quick Start

Create a hook that automatically approves reading markdown files by using the hook skill.

Frequently Asked Questions about hook-skill

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

FAQPage Schema
How do I automate custom logic execution at specific lifecycle events in Claude Code?

You can automate custom logic in Claude Code by configuring hooks for specific lifecycle events like PreToolUse, PostToolUse, SessionStart, and Stop using JSON-defined configurations and stdin/stdout communication.

Can I validate inputs and automatically approve actions before a tool runs in Claude Code?

Yes, you can validate inputs and automatically approve actions before a tool runs by implementing a PreToolUse hook to intercept tool calls and control behavioral execution.

How do I prevent dangerous bash commands from executing during a Claude Code session?

You prevent dangerous bash commands by implementing PreToolUse hooks that intercept tool calls, validate inputs, and block unwanted operations like executing destructive terminal commands.

What is the mechanism for intercepting and modifying tool outputs in Claude Code?

The mechanism for intercepting and modifying tool outputs involves configuring PostToolUse hooks that intercept outputs, apply custom validation logic, and modify behavioral control through stdin/stdout communication.

How do I configure Claude Code hooks to execute custom scripts or prompts?

You configure Claude Code hooks by defining JSON configurations that specify command or prompt-based hook types to execute custom scripts or prompts based on predefined events.

Does setting up Claude Code hooks require managing external dependencies?

No, setting up Claude Code hooks does not require external dependencies, as the configuration relies entirely on JSON-defined settings and standard stdin/stdout communication for event handling.