hook-creator
Skill438 starsChanged 7 months agoMITView on GitHub
Create and configure Claude Code hooks for customizing agent behavior. Use when the user wants to (1) create a new hook, (2) configure automatic formatting, logging, or notifications, (3) add file protection or custom permissions, (4) set up pre/post tool execution actions, or (5) asks about hook events like PreToolUse, PostToolUse, Notification, etc.
- Reads credentials
4 other projects use a version of this.
Adopted by
Most recently taken up by
- tygwan/cc-initializer-windowsword for word, first seen Oct 20, 2026
- gravity9-tech/claude_code_workshoptheir own version, first seen Mar 11, 2026
- tygwan/cc-initializerword for word, first seen Jan 24, 2026
- tygwan/skillsword for word, first seen Nov 12, 2025
Other versions4 projects use a version of this.
Word for word · 3
- tygwan/skills★ 1100% same
- tygwan/cc-initializer★ 0100% same
- tygwan/cc-initializer-windows★ 0100% same
Edited · 0
None found.
Wrote their own version · 1
- gravity9-tech/claude_code_workshop★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- cc-usage-auditSkill
- commitSkill
- discord-messageSkill
- email-draftSkill
- gmailSkill
- google-calendarSkill
- ideationSkill
- persuasion-reviewSkill
- plan-and-buildSkill
- shipSkill
- skill-creatorSkill
- slash-command-creatorSkill
- subagent-creatorSkill
- transcribeSkill
- youtube-collectorSkill
- harness-starterSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Create Claude Code hooks that execute shell commands at specific lifecycle events.
- Distinctive: line 14
Design the hook command: - Write shell command that processes JSON input from stdin
- Distinctive: line 17
Test the hook: - Verify behavior with a simple test case
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hook Creator
Create Claude Code hooks that execute shell commands at specific lifecycle events.
Hook Creation Workflow
- Identify the use case - Determine what the hook should accomplish
- Select the appropriate event - Choose from available hook events (see references/hook-events.md)
- Design the hook command - Write shell command that processes JSON input from stdin
- Configure the matcher - Set tool/event filter (use
*for all, or specific tool names likeBash,Edit|Write) - Choose storage location - User settings (
~/.claude/settings.json) or project (.claude/settings.json) - Test the hook - Verify behavior with a simple test case
Hook Configuration Structure
{
"hooks": {
"<EventName>": [
{
"matcher": "<ToolPattern>",
"hooks": [
{
"type": "command",
"command": "<shell-command>"
}
]
}
]
}
}Common Patterns
Reading Input Data
Hooks receive JSON via stdin. Use jq to extract fields:
# Extract tool input field
jq -r '.tool_input.file_path'
# Extract with fallback
jq -r '.tool_input.description // "No description"'
# Conditional processing
jq -r 'if .tool_input.file_path then .tool_input.file_path else empty end'Exit Codes for PreToolUse
0- Allow the tool to proceed2- Block the tool and provide feedback to Claude
Matcher Patterns
*- Match all toolsBash- Match only Bash toolEdit|Write- Match Edit or Write toolsRead- Match Read tool
Quick Examples
Log all bash commands:
jq -r '"\(.tool_input.command)"' >> ~/.claude/bash-log.txtAuto-format TypeScript after edit:
jq -r '.tool_input.file_path' | { read f; [[ "$f" == *.ts ]] && npx prettier --write "$f"; }Block edits to .env files:
python3 -c "import json,sys; p=json.load(sys.stdin).get('tool_input',{}).get('file_path',''); sys.exit(2 if '.env' in p else 0)"Resources
- Hook Events Reference: See
references/hook-events.mdfor detailed event documentation with input/output schemas - Example Configurations: See
references/examples.mdfor complete, tested hook configurations
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

