hooks-creator

Configure Claude Code hooks for lifecycle events with templates and scripts.

1|Updated Aug 6, 2022
One-click install
npx skills add https://github.com/wormholecowboy/.dotfiles --skill hooks-creator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hooks-creator
Source: https://github.com/wormholecowboy/.dotfiles/tree/main/claude-config/skills/hooks-creator
Command: npx skills add https://github.com/wormholecowboy/.dotfiles --skill hooks-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers build Claude Code hooks for automated execution at lifecycle events, reducing manual setup and ensuring consistent behavior.

Core Features & Use Cases

  • Define hook events for PreToolUse, PostToolUse, Notification, UserPromptSubmit, Stop, SubagentStop, PreCompact, SessionStart, and SessionEnd.
  • Provide templates and examples for hook scripts (Python and Bash) and a clear configuration format.
  • Manage hook scope (project, local, user) and reference environment variables and safety considerations.

Quick Start

Create a new skill under claude-config/skills/hooks-creator with SKILL.md (frontmatter name/description) and add a sample hook configuration like a PostToolUse hook with a simple Python script that logs the executed command. Then add a supporting script in scripts/ and a reference in references/, to illustrate the workflow.

Frequently Asked Questions about hooks-creator

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

FAQPage Schema
How do I automate Claude Code lifecycle events with hooks?

You can automate lifecycle events by defining Claude Code hooks for events like PreToolUse, PostToolUse, Notification, and Stop. Configure these hooks across project, local, or user scopes to trigger scripts automatically and reduce manual setup.

What lifecycle events are supported by Claude Code hooks?

Claude Code hooks support PreToolUse, PostToolUse, Notification, UserPromptSubmit, Stop, SubagentStop, PreCompact, SessionStart, and SessionEnd. These events cover the full lifecycle from session initialization to tool execution and termination.

How do I configure hook scope for project, local, or user levels?

Hook scope is managed by defining configurations in settings files at the project, local, or user level. This Skill provides templates and a defined configuration format to ensure correct scope placement and consistent behavior across environments.

Can I use Python and Bash scripts for Claude Code hooks?

Yes, Claude Code hooks support both Python and Bash scripts. The Skill provides templates and examples for both languages, allowing you to log commands, send notifications, or enforce safety checks during lifecycle events.

What configuration format is required for Claude Code hooks?

Claude Code hooks require a defined configuration format with frontmatter requirements including name and description. You create a SKILL.md file and add supporting scripts and references to ensure proper execution and environment variable handling.

Are there safety considerations when automating Claude Code lifecycle events?

Safety considerations are necessary when automating lifecycle events with hooks. The Skill references environment variables and safety guidelines to prevent unintended side effects, ensuring scripts execute securely during PreToolUse, PostToolUse, and other triggered events.