hook-creator

Create and configure Claude Code hooks for lifecycle events with JSON.

434|168|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/greatSumini/cc-system --skill hook-creator-greatsumini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-creator
Source: https://github.com/greatSumini/cc-system/tree/main/.claude/skills/hook-creator
Command: npx skills add https://github.com/greatSumini/cc-system --skill hook-creator-greatsumini

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides creating and configuring Claude Code hooks to automate, log, format, and respond to lifecycle events.

Core Features & Use Cases

  • Event-driven hooks: Define PreToolUse, PostToolUse, Notification, and other hooks.
  • Matcher-based actions: Specify which tools/events trigger hooks and what commands run.
  • Project vs. user scope: Store configurations in project or user settings.

Quick Start

Create or edit a hook configuration (e.g., in ~/.claude/settings.json or .claude/settings.json) and define basic PreToolUse actions.

Frequently Asked Questions about hook-creator

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

FAQPage Schema
How do I automate Claude Code actions using hooks?

Hooks let you automate Claude Code behavior across lifecycle events like PreToolUse, PostToolUse, and SessionStart. Define event-triggered commands in a JSON configuration file (in ~/.claude/settings.json or .claude/settings.json) that specify which tools or events fire actions, then Claude Code executes them automatically.

What lifecycle events can I configure hooks for?

Claude Code supports five lifecycle events for hooks: PreToolUse (before tool execution), PostToolUse (after tool execution), Notification (alert events), SessionStart (when a session begins), and SessionEnd (when a session ends). Each event type lets you attach custom command blocks and matchers.

How do I enable file protection and logging with hooks?

Use PreToolUse hooks with tool matchers to inspect incoming commands. Configure hooks to run logging or validation scripts that read stdin with jq, then return exit code 0 to allow or exit code 2 to block actions. Store hook definitions in project or user settings for persistent protection.

Can I apply hooks at project scope instead of user scope?

Yes. Hooks can be stored in either user settings (~/.claude/settings.json) for global application or project settings (.claude/settings.json) for local scope. Project-scoped hooks override user settings and let you enforce team-specific automation and permissions.

Do hooks work with custom permissions and pre/post tool actions?

Hooks support custom permission enforcement through exit codes and pre/post tool command blocks. Define matcher-based conditions that trigger specific actions before or after tools run, enabling automatic formatting, custom workflows, and permission validation without modifying agent code.