hook-creator

Create event hooks for Claude Code to automate workflows.

2|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/jbabin91/super-claude --skill hook-creator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-creator
Source: https://github.com/jbabin91/super-claude/tree/main/plugins/claude-tools/skills/hook-creator
Command: npx skills add https://github.com/jbabin91/super-claude --skill hook-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually configuring event-driven hooks for Claude Code can be tricky, requiring precise JSON formatting and a deep understanding of event types and filters. This Skill simplifies the creation of hooks, enabling seamless automation of tasks based on specific Claude Code events, saving you from repetitive manual actions.

Core Features & Use Cases

  • Event-Driven Automation: Generates hooks that trigger shell commands or scripts before/after user prompts, tool calls (like file writes), or session start/end events.
  • Workflow Integration: Perfect for automating code formatting on save, running type checks before commits, validating API schemas after changes, or triggering accessibility checks on component edits.
  • Use Case: You want to ensure all TypeScript files are automatically formatted and linted every time they are saved. Use this Skill to create a hook that triggers prettier --write $FILE && eslint --fix $FILE after a Write tool call on *.ts files, ensuring consistent code quality without any manual intervention.

Quick Start

Example: Create a hook to format files on save

First, ensure the 'skill-tools' plugin is installed:

/plugin install skill-tools

Then, in Claude Code, simply ask:

"Create a hook to automatically format TypeScript files after I save them."

The skill will prompt for the event type, command to run, and specific filters.

Frequently Asked Questions about hook-creator

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

FAQPage Schema
How do I automate code formatting and linting on file save?

Event-driven hooks trigger shell commands automatically after specific Claude Code actions. Create a hook that runs on file writes with filters for file types—for example, trigger `prettier --write $FILE && eslint --fix $FILE` after saving TypeScript files to enforce consistent formatting without manual steps.

What events can trigger Claude Code hooks?

Hooks respond to four core events: user-prompt-submit, tool-call, session-start, and session-end. Each event supports before/after timing, enabling automation at different workflow stages. Tool calls capture file writes, reads, and other operations for precise filtering.

Can I run different commands based on file type or tool action?

Yes. Hooks support granular filters for tool type, file patterns, and prompt content. Combine filters to run specific commands only when conditions match—for instance, validate API schemas only after writes to `*.json` files, or lint components only after edits to `*.tsx` files.

How do I set up hooks for my project?

Define hooks in JSON format specifying the event, command, timing (before/after), and filters. Hooks can be global or project-local. The Skill validates JSON structure, command executability, and filter criteria before outputting a deployment-ready configuration.

Do hooks work for both global and project-specific workflows?

Yes. Hooks support both global scope across all Claude Code sessions and project-local scope for repository-specific automation. Use project-local hooks to enforce team standards, global hooks for personal workflow preferences.

What happens if a hook command fails during execution?

The metadata specifies that hooks ensure command executability validation before deployment. Precise configuration and command validation help prevent runtime failures, though the Skill focuses on correct setup rather than error recovery handling.