hook-creator

Create Claude Code lifecycle hooks with Bash scripts and validation.

161|21|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/softspark/ai-toolkit --skill hook-creator-softspark
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-creator
Source: https://github.com/softspark/ai-toolkit/tree/main/app/skills/hook-creator
Command: npx skills add https://github.com/softspark/ai-toolkit --skill hook-creator-softspark

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Developers need a reliable, guided way to create Claude Code lifecycle hooks that follow strict conventions and include validation, without manually handling script scaffolding and registration.

Core Features & Use Cases

  • Guided workflow for capturing intent, selecting events, and defining matchers.
  • Ready‑made Bash script template with environment‑aware profiling.
  • Automatic registration of the hook in app/hooks.json.
  • Built‑in validation via scripts/validate.py to ensure correctness before deployment.

Quick Start

Ask the assistant to generate a PreToolUse hook that logs the invoked tool name.

Frequently Asked Questions about hook-creator

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

FAQPage Schema
How do I create Claude Code lifecycle hooks for PreToolUse and PostToolUse events?

You create Claude Code lifecycle hooks by defining Bash scripts in the app/hooks directory and registering them in hooks.json. This Skill guides you through capturing intent, selecting events, and defining matchers to generate the hook scaffolding automatically.

What is the best way to validate Bash scripts for Claude hooks before deployment?

Validating Bash scripts for Claude hooks requires running a validation script like scripts/validate.py. This ensures correctness and strict convention adherence before deployment, preventing errors in PreToolUse, PostToolUse, or SessionStart event triggers.

Do I need to manually edit hooks.json to register a new Claude hook?

No, you do not need to manually edit hooks.json to register a new Claude hook. The generation workflow handles automatic registration of the hook configuration in the hooks.json file while scaffolding the required Bash script template.

Can I use environment-aware profiling when generating Bash hook scripts?

Yes, you can use environment-aware profiling when generating Bash hook scripts. The Skill provides a ready-made Bash script template that includes environment-aware profiling capabilities for your Claude Code lifecycle events.

Why does my Claude hook fail validation after adding a custom script?

Claude hook validation fails when scripts do not follow strict conventions. Ensure your Bash scripts are placed correctly in the app/hooks directory and pass checks through scripts/validate.py to confirm structural correctness before triggering lifecycle events.

When do I need to define matchers for Claude Code session hooks?

You define matchers for Claude Code session hooks during the guided workflow to specify which tool invocations trigger your scripts. Matchers are essential for filtering events like PreToolUse and PostToolUse before the hook executes.