hooks-management

Create, update, and validate coding-agent hooks for Claude Code, Codex CLI, and OpenCode.

119|10|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/CodeAlive-AI/ai-driven-development --skill hooks-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hooks-management
Source: https://github.com/CodeAlive-AI/ai-driven-development/tree/main/skills/hooks-management
Command: npx skills add https://github.com/CodeAlive-AI/ai-driven-development --skill hooks-management

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill eliminates the friction of configuring and maintaining automation hooks across AI coding agents, while helping you avoid risky or incorrect hook behavior.

Core Features & Use Cases

  • Unified hook management across agents: Manage hooks and automation for Claude Code, Codex CLI, and OpenCode using consistent natural-language instructions and platform-specific mappings.
  • Event and matcher guidance: Covers hook events, handler types, and matcher patterns so hooks trigger reliably on the intended actions (e.g., PreToolUse, PostToolUse, SessionStart).
  • Safety-focused decision control: Provides the canonical PreToolUse permission model (allow/deny/ask/defer) to ensure correct confirmation UX instead of brittle custom schemes.
  • Validation and troubleshooting: Uses a validation workflow (e.g., scripts/validate_hooks.py) and includes targeted troubleshooting for common failure modes like non-triggering hooks or invalid configs.

Quick Start

Ask your agent to add a PreToolUse hook that asks you for confirmation before running any destructive shell command, and to validate the resulting settings before saving.

Frequently Asked Questions about hooks-management

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

FAQPage Schema
How do I add a PreToolUse hook to ask for confirmation before running destructive shell commands?

You can automate PreToolUse hook creation by asking your agent in natural language to intercept destructive shell commands. The Skill applies the canonical allow/deny/ask/defer permission semantics to ensure a correct confirmation UX for tool interception.

Can I manage Claude Code and Codex CLI hooks using the same configuration workflow?

Yes, you can manage Claude Code, Codex CLI, and OpenCode hooks using consistent natural-language instructions. The Skill applies platform-specific mappings to update user and project settings files with validated JSON or TOML configurations.

Why does my agent hook fail to trigger on intended actions?

Agent hooks fail to trigger when event names or matcher patterns are incorrect. The Skill provides event and matcher guidance for PreToolUse, PostToolUse, and SessionStart, and includes a validation workflow to troubleshoot non-triggering hooks or invalid configs.

What is the best way to validate coding-agent hook configurations before saving?

The best way to validate coding-agent hook configurations is using the provided validation workflow like scripts/validate_hooks.py. This checks for correct event names, matchers, and safe JSON/TOML configuration updates across settings files before saving.

Do I need to restart my coding agent after updating hook settings?

Yes, you need to restart your coding agent after updating hook settings because the Skill follows a restart-after-change workflow. This ensures the new PreToolUse or PostToolUse automation and permission controls are properly loaded into the session.