Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Meta Hook Creator

  • 62 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

meta-hook-creator is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • meta-hook-creator
  • AI & Agent Building
  • AI-coding skill

Meta Hook Creator by the numbers

  • 62 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #6,310 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill meta-hook-creator

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs62
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Hook Creator

Overview

Claude Code hooks are user-defined shell commands, LLM prompts, or agent evaluations that execute automatically at specific lifecycle points. Hooks receive JSON context via stdin, take action, and communicate results through exit codes, stdout, and stderr.

When to use: Blocking dangerous commands, auto-formatting after writes, protecting sensitive files, custom notifications, environment setup, enforcing project conventions, auto-approving safe tools, running tests after changes.

When NOT to use: Static context injection (use CLAUDE.md), simple permission rules (use allowlist settings), one-time setup (use shell scripts directly).

Quick Reference

PatternEventMatcherKey Points
Block tool callPreToolUseTool nameExit 2 or JSON permissionDecision: "deny"
Auto-approve toolPreToolUseTool nameJSON permissionDecision: "allow"
Modify tool inputPreToolUseTool nameJSON updatedInput with modified parameters
Format after writePostToolUse`Write\Edit`
Log tool failuresPostToolUseFailureTool nameFires when tool throws error or returns failure
Handle permissionPermissionRequestTool nameJSON decision.behavior: "allow" or "deny"
Validate user promptUserPromptSubmitNo matcherExit 2 blocks prompt, stdout adds context
Desktop notificationNotificationNotification typepermission_prompt, idle_prompt, etc.
Force continueStopNo matcherJSON decision: "block" with reason
Subagent lifecycleSubagentStopAgent typeSame decision control as Stop
Environment setupSessionStartSource typeWrite to CLAUDE_ENV_FILE to persist env vars
Session cleanupSessionEndExit reasonCannot block termination
Pre-compact contextPreCompact`manual\auto`
Background tasksAny post-eventAnySet async: true on command hooks
LLM evaluationSupported eventsAnyUse type: "prompt" for single-turn LLM check
Multi-turn verificationSupported eventsAnyUse type: "agent" for subagent with tool access

Common Mistakes

MistakeCorrect Pattern
Exit 1 expecting to block a tool callUse exit 2 to block in PreToolUse and PermissionRequest
Printing JSON on exit 2JSON output is only processed on exit 0; stderr is used on exit 2
Complex inline bash in settings.jsonExtract to a script file, reference with $CLAUDE_PROJECT_DIR
Missing timeout on slow hooksSet timeout field; defaults are 600s command, 30s prompt, 60s agent
Not quoting $CLAUDE_PROJECT_DIRAlways quote: "$CLAUDE_PROJECT_DIR"/.claude/hooks/script.sh
Expecting CLAUDE_ENV_FILE in all hooksOnly available in SessionStart hooks
Adding matcher to Stop or UserPromptSubmitThese events ignore matchers; they always fire
Using decision/reason at top level for PreToolUseUse hookSpecificOutput.permissionDecision and permissionDecisionReason
Not checking stop_hook_active in Stop hooksCheck this field to prevent infinite continuation loops
Mixing exit codes and JSON decisionsChoose one approach per hook: exit codes alone or exit 0 with JSON

Delegation

  • Hook pattern discovery: Use Explore agent to find existing hooks in the project
  • Hook testing and verification: Use Task agent to validate hook behavior
  • Code review: Delegate to code-reviewer agent for hook script review

References

  • Event types, matchers, and input schemas
  • Hook configuration, exit codes, JSON output, and environment variables
  • Hook templates for common automation patterns

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.