Agent skill

Creating Claude Code Hooks

by pr-pm in pr-pm/prpm

Covers how to build, configure and publish Claude Code hooks: event types, exit codes, JSON I/O, and PRPM packaging.

MITAuto-check: notesAgent Workflows

Install Creating Claude Code Hooks

skills CLI
$ npx skills add pr-pm/prpm --skill creating-claude-hooks -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pr-pm/prpm creating-claude-hooks --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pr-pm/prpm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/creating-claude-hooks .claude/skills/creating-claude-hooks && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
creating-claude-hooks
GitHub stars
122
Used in
2 other repos
Token cost
~3.9k tokens
SKILL.md length
899 words
Files
1
Skills in repo
35
Repo updated
First seen
Licence
MIT

At a glance

Covers how to build, configure and publish Claude Code hooks: event types, exit codes, JSON I/O, and PRPM packaging.

  • Works in 6 steps: Keep Hooks Fast → Handle Errors Gracefully → Use Shebangs → …
  • Creating a new Claude Code hook
  • SKILL.md covers When to Use This Skill, Quick Reference, JSON Hook Configuration and Command Hooks, plus 5 more sections
  • Calls jq and prettier

What it does

Two ways to wire a hook are laid out: JSON configuration in settings.json or a plugin's hooks.json, which supports both command and prompt hooks with matchers and timeouts, versus an executable file placed under .claude/hooks/<event-name>, simpler but less configurable. Command hooks run an external script in milliseconds for formatting, logging or file checks, while prompt hooks use LLM reasoning over several seconds for complex validation or security analysis.

A table of events covers PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, Stop, SubagentStop, PreCompact, Notification and PermissionRequest, noting which can block the action and typical uses for each, alongside the exit-code contract: 0 continues normally, 2 blocks the operation during PreToolUse, and any other code is logged as an error while the session continues. It also covers packaging a finished hook as a PRPM package.

When your agent uses it

  • Creating a new Claude Code hook
  • Choosing between a command hook and a prompt hook
  • Publishing a hook as a PRPM package
  • Troubleshooting why a hook isn't firing or blocking as expected

Example prompts

  • “Create a PreToolUse hook that blocks edits to the production config.”
  • “What's the difference between a command hook and a prompt hook?”
  • “Package this hook as a PRPM package for publishing.”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Keep Hooks Fast
  2. Handle Errors Gracefully
  3. Use Shebangs
  4. Secure Sensitive Files
  5. Quote All Variables
  6. Log for Debugging

What it can do on your machine

Read from SKILL.md and the folder at commit 5f993e6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • jq
    • prettier

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.claude.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Creating Claude Code Hooks loads about 3.9k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 899 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~3.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:189
    // Block .env files
  • NoteMentions a .env fileSKILL.md:190
    if (filePath.endsWith('.env')) {
  • NoteMentions a .env fileSKILL.md:191
    console.error('Blocked: Cannot modify .env files');
  • NoteMentions a .env fileSKILL.md:493
    BLOCKED=(".env" ".env.*" "*.pem" "*.key")

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pr-pm/prpm at commit 5f993e6, republished under its MIT licence (© pr-pm). 899 words, ~3,875 tokens.

Download SKILL.mdSave it as .claude/skills/creating-claude-hooks/SKILL.md (or your agent's skills folder).
name
creating-claude-hooks
description
Use when creating or publishing Claude Code hooks - covers executable format, event types, JSON I/O, exit codes, security requirements, and PRPM package structure

Creating Claude Code Hooks

Use this skill when creating, improving, or publishing Claude Code hooks. Provides essential guidance on hook format, event handling, I/O conventions, and package structure.

When to Use This Skill

Activate this skill when:

  • User asks to create a new Claude Code hook
  • User wants to publish a hook as a PRPM package
  • User needs to understand hook format or events
  • User is troubleshooting hook execution
  • User asks about hook vs skill vs command differences

Quick Reference

Two Hook Configuration Methods

Method 1: JSON Configuration (Recommended)

  • Configure in .claude/settings.json, ~/.claude/settings.json, or plugin's hooks.json
  • Supports both command hooks and prompt hooks
  • More flexible, supports matchers and timeouts

Method 2: Executable Files (Legacy)

  • Place executables in .claude/hooks/<event-name>
  • Simpler but less configurable
Hook Types
TypeDescriptionSpeedUse Case
CommandRuns external scriptFast (ms)Formatting, logging, file checks
PromptUses LLM reasoningSlow (2-10s)Complex validation, security analysis
Available Events
EventWhen It FiresCan Block?Common Use Cases
PreToolUseBefore tool executionYes (exit 2)Validation, permission checks, input modification
PostToolUseAfter tool completesNoFormatting, logging, cleanup
UserPromptSubmitBefore user input processesYesPrompt validation, enhancement
SessionStartNew session beginsNoEnvironment setup, context loading
StopWhen assistant finishesNoCleanup, summary, verification
SubagentStopWhen subagent finishesNoSubagent result processing
PreCompactBefore context compactionNoSave important context
NotificationDuring alertsNoDesktop notifications, logging
PermissionRequestWhen permission neededYesCustom permission handling
Exit Codes
CodeMeaningBehavior
0SuccessContinue normally
2BlockStop operation (PreToolUse only)
1 or otherErrorLog error, continue

JSON Hook Configuration

Settings-Based Hooks

Configure hooks in .claude/settings.json (project) or ~/.claude/settings.json (global):

json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{
        "type": "command",
        "command": "/path/to/validate-write.sh",
        "timeout": 5000
      }]
    }],
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{
        "type": "command",
        "command": "/path/to/format-file.sh"
      }]
    }],
    "Stop": [{
      "matcher": "*",
      "hooks": [{
        "type": "prompt",
        "prompt": "Verify all requested changes were completed."
      }]
    }]
  }
}
Plugin hooks.json

For PRPM packages, use hook.json:

json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write",
      "hooks": [{
        "type": "command",
        "command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh",
        "timeout": 5000
      }]
    }]
  }
}
Matcher Patterns
PatternMatches
"Write"Only Write tool
"Write|Edit"Write OR Edit tools
"Bash"Only Bash tool
"mcp__github__*"All GitHub MCP tools
"*"All tools (use sparingly)
Hook Options
json
{
  "type": "command",
  "command": "./my-hook.sh",
  "timeout": 5000,
  "once": true,
  "continue": true,
  "stopReason": "Message when blocked",
  "suppressOutput": false,
  "systemMessage": "Warning to show user"
}
OptionTypeDefaultDescription
timeoutnumber60000Max execution time in ms
oncebooleanfalseRun only once per session
continuebooleantrueContinue after hook completes
stopReasonstring-Message when continue=false
suppressOutputbooleanfalseHide stdout from transcript
systemMessagestring-Warning message to user

Command Hooks

Command hooks run external scripts. They're fast and deterministic.

Shell Script Hook
bash
#!/bin/bash
set -euo pipefail

# Read JSON input
INPUT=$(cat)
FILE=$(echo "$INPUT" | jq -r '.input.file_path // empty')

# Validate
[[ -n "$FILE" ]] || exit 0
[[ -f "$FILE" ]] || exit 0

# Block sensitive files
case "$FILE" in
  *.env|*.pem|*.key)
    echo "Blocked: $FILE is sensitive" >&2
    exit 2
    ;;
esac

exit 0
TypeScript Hook
typescript
#!/usr/bin/env node
import { readFileSync } from 'fs';

const input = JSON.parse(readFileSync(0, 'utf-8'));
const filePath = input.input?.file_path;

if (!filePath) process.exit(0);

// Block .env files
if (filePath.endsWith('.env')) {
  console.error('Blocked: Cannot modify .env files');
  process.exit(2);
}

process.exit(0);

Prompt Hooks

Prompt hooks use LLM reasoning for complex validation. Use sparingly - they take 2-10 seconds.

Basic Prompt Hook
json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write",
      "hooks": [{
        "type": "prompt",
        "prompt": "Check if the content being written contains hardcoded secrets, API keys, or credentials. If found, block the operation."
      }]
    }]
  }
}
Prompt Hook with Schema Validation
json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{
        "type": "prompt",
        "prompt": "Analyze the file content for security issues. Return your decision.",
        "schema": {
          "type": "object",
          "properties": {
            "decision": {
              "type": "string",
              "enum": ["allow", "block"]
            },
            "reason": {
              "type": "string"
            },
            "severity": {
              "type": "string",
              "enum": ["low", "medium", "high", "critical"]
            }
          },
          "required": ["decision"]
        }
      }]
    }]
  }
}
When to Use Prompt Hooks

Good use cases:

  • Security analysis that requires understanding code context
  • Detecting logic errors or anti-patterns
  • Validating architectural decisions
  • Complex permission checks

Avoid for:

  • Simple pattern matching (use command hooks)
  • File extension checks
  • Path validation
  • Anything that can be done with regex

File-Based Hooks (Legacy)

Simpler approach - place executables directly in hooks directory.

File Location

Project hooks:

.claude/hooks/PreToolUse
.claude/hooks/PostToolUse
.claude/hooks/SessionStart

User-global hooks:

~/.claude/hooks/PreToolUse
~/.claude/hooks/Stop
Requirements

Every file-based hook MUST:

  1. Have a shebang line:
bash
#!/bin/bash
#!/usr/bin/env node
#!/usr/bin/env python3
  1. Be executable:
bash
chmod +x .claude/hooks/PreToolUse
  1. Handle JSON input from stdin

  2. Exit with appropriate code

JSON Input Structure

Hooks receive JSON via stdin:

json
{
  "session_id": "abc123",
  "transcript_path": "/path/to/transcript.jsonl",
  "current_dir": "/path/to/project",
  "tool_name": "Write",
  "input": {
    "file_path": "/path/to/file.ts",
    "content": "file contents...",
    "command": "npm test",
    "old_string": "...",
    "new_string": "..."
  }
}
Tool-Specific Input Fields
ToolAvailable Fields
Writefile_path, content
Editfile_path, old_string, new_string
Readfile_path
Bashcommand
Globpattern, path
Greppattern, path

Environment Variables

Available in hook execution:

VariableDescription
CLAUDE_PROJECT_DIRProject root directory
CLAUDE_CURRENT_DIRCurrent working directory
CLAUDE_PLUGIN_ROOTHook installation directory
CLAUDE_ENV_FILEFile for persisting variables
SESSION_IDCurrent session identifier
Show full SKILL.md (360 more words)Show less

Common Patterns

Pattern 1: Format on Save
json
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{
        "type": "command",
        "command": "${CLAUDE_PLUGIN_ROOT}/scripts/format.sh",
        "timeout": 5000
      }]
    }]
  }
}
Pattern 2: Block Sensitive Files
json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write|Edit|Read",
      "hooks": [{
        "type": "command",
        "command": "${CLAUDE_PLUGIN_ROOT}/scripts/block-sensitive.sh"
      }]
    }]
  }
}
Pattern 3: Test Verification Before Stop
json
{
  "hooks": {
    "Stop": [{
      "matcher": "*",
      "hooks": [{
        "type": "prompt",
        "prompt": "Before finishing, verify: 1) All tests pass 2) No linting errors 3) Types check. If any issues, list them."
      }]
    }]
  }
}
Pattern 4: Session Context Loading
json
{
  "hooks": {
    "SessionStart": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "${CLAUDE_PLUGIN_ROOT}/scripts/load-context.sh",
        "once": true
      }]
    }]
  }
}
Pattern 5: Multi-Stage Validation

Combine PreToolUse (validate) with PostToolUse (verify):

json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write",
      "hooks": [{
        "type": "command",
        "command": "./validate-before.sh"
      }]
    }],
    "PostToolUse": [{
      "matcher": "Write",
      "hooks": [{
        "type": "command",
        "command": "./verify-after.sh"
      }]
    }]
  }
}

Common Mistakes

MistakeProblemSolution
Not quoting variablesBreaks on spacesAlways use "$VAR"
Missing shebangWon't executeAdd #!/bin/bash
Not executablePermission deniedRun chmod +x hook-file
Logging to stdoutClutters transcriptUse stderr: echo "log" >&2
Wrong exit codeDoesn't block when neededUse exit 2 to block
No input validationSecurity riskAlways validate JSON fields
Slow operationsBlocks ClaudeRun in background or use PostToolUse
Absolute paths missingCan't find scriptsUse ${CLAUDE_PLUGIN_ROOT}
Using * matcherRuns on everythingBe specific: Write|Edit
Prompt hooks everywhereSlow experienceUse only for complex logic

Best Practices

1. Keep Hooks Fast

Target < 100ms for PreToolUse hooks:

  • Cache results where possible
  • Run heavy operations in background
  • Use specific matchers, not wildcards
2. Handle Errors Gracefully
bash
# Check dependencies exist
if ! command -v jq &> /dev/null; then
  echo "jq not installed, skipping" >&2
  exit 0
fi

# Validate input
FILE=$(echo "$INPUT" | jq -r '.input.file_path // empty')
if [[ -z "$FILE" ]]; then
  echo "No file path provided" >&2
  exit 1
fi
3. Use Shebangs

Always start with shebang:

bash
#!/bin/bash
#!/usr/bin/env node
#!/usr/bin/env python3
4. Secure Sensitive Files
bash
BLOCKED=(".env" ".env.*" "*.pem" "*.key")
for pattern in "${BLOCKED[@]}"; do
  case "$FILE" in
    $pattern)
      echo "Blocked: $FILE is sensitive" >&2
      exit 2
      ;;
  esac
done
5. Quote All Variables
bash
# WRONG - breaks on spaces
prettier --write $FILE

# RIGHT - handles spaces
prettier --write "$FILE"
6. Log for Debugging
bash
LOG_FILE=~/.claude-hooks/debug.log

# Log to file
echo "[$(date)] Processing $FILE" >> "$LOG_FILE"

# Log to stderr (shows in transcript)
echo "Hook running..." >&2

Publishing as PRPM Package

Package Structure
my-hook/
├── prpm.json          # Package manifest
├── HOOK.md            # Hook documentation
└── hook-script.sh     # Hook executable
prpm.json
json
{
  "name": "@username/hook-name",
  "version": "1.0.0",
  "description": "Brief description shown in search",
  "author": "Your Name",
  "format": "claude",
  "subtype": "hook",
  "tags": ["automation", "security", "formatting"],
  "main": "HOOK.md"
}
HOOK.md Format
markdown
---
name: session-logger
description: Logs session start/end times for tracking
event: SessionStart
language: bash
hookType: hook
---

# Session Logger Hook

Logs Claude Code session activity for tracking and debugging.

## Installation

This hook will be installed to `.claude/hooks/session-start`.

## Behavior

- Logs session start time to `~/.claude/session.log`
- Displays environment status
- Runs silent dependency checks

## Requirements

- bash 4.0+
- write access to `~/.claude/`

## Source Code

\`\`\`bash
#!/bin/bash
echo "Session started at $(date)" >> ~/.claude/session.log
echo "Environment ready"
exit 0
\`\`\`
Publishing Process
bash
# Test locally first
prpm test

# Publish to registry
prpm publish

# Version bumps
prpm publish patch  # 1.0.0 -> 1.0.1
prpm publish minor  # 1.0.0 -> 1.1.0
prpm publish major  # 1.0.0 -> 2.0.0

Security Requirements

Input Validation
bash
# Parse JSON safely
INPUT=$(cat)
if ! FILE=$(echo "$INPUT" | jq -r '.input.file_path // empty' 2>&1); then
  echo "JSON parse failed" >&2
  exit 1
fi

# Validate field exists
[[ -n "$FILE" ]] || exit 1
Path Sanitization
bash
# Prevent directory traversal
if [[ "$FILE" == *".."* ]]; then
  echo "Path traversal detected" >&2
  exit 2
fi

# Keep in project directory
if [[ "$FILE" != "$CLAUDE_PROJECT_DIR"* ]]; then
  echo "File outside project" >&2
  exit 2
fi
User Confirmation

Claude Code automatically:

  • Requires confirmation before installing hooks
  • Shows hook source code to user
  • Warns about hook execution
  • Displays hook output in transcript

Hooks vs Skills vs Commands

FeatureHooksSkillsCommands
FormatExecutable codeMarkdownMarkdown
TriggerAutomatic (events)Automatic (context)Manual (/command)
LanguageAny executableN/AN/A
Use CaseAutomation, validationReference, patternsQuick tasks
SecurityRequires confirmationNo special permissionsInherits from session

Examples:

  • Hook: Auto-format files on save
  • Skill: Reference guide for testing patterns
  • Command: /review-pr quick code review
  • claude-hook-writer skill - Detailed hook development guidance
  • typescript-hook-writer skill - TypeScript-specific hook development
  • Claude Code Docs
  • Schema

Checklist for New Hooks

Before publishing:

  • Shebang line included
  • File is executable (chmod +x)
  • Validates all stdin input
  • Quotes all variables
  • Handles missing dependencies gracefully
  • Uses appropriate exit codes
  • Logs errors to stderr or file
  • Tests with edge cases (spaces, Unicode, missing fields)
  • Documents dependencies in HOOK.md
  • Includes installation instructions
  • Source code included in documentation
  • Clear description and tags in prpm.json
  • Version number is semantic

© pr-pm, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/creating-claude-hooks of pr-pm/prpm.

Open the folder on GitHubat commit 5f993e6

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in pr-pm/prpm, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Creating Claude Code Hooks next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Creating Claude Code Hooks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Creating Claude Code Hooks this skillpr-pm/prpm1222 repos~3.9kAutomated safety check: NotesMIT
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k11 repos~4.1kAutomated safety check: NotesApache-2.0
Claude Code Agent Developmentanthropics/claude-plugins-official38k8 repos~2.8kAutomated safety check: PassApache-2.0
Claude Code Skill Developer Guidediet103/claude-code-infrastructure-showcase10k11 repos~3.5kAutomated safety check: PassMIT
Plugin Settings Patternanthropics/claude-plugins-official38k7 repos~3kAutomated safety check: PassApache-2.0
MCP Integration for Pluginsanthropics/claude-plugins-official38k11 repos~3.1kAutomated safety check: PassApache-2.0

Similar skills

  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 11 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 8 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Skill Developer Guide

    diet103/claude-code-infrastructure-showcase

    A guide to creating and managing Claude Code skills with auto-activation: skill-rules.json triggers, hooks, enforcement levels, YAML frontmatter and progressive disclosure.

    10k GitHub starsUsed in 11 repos~3.5k tokens
    Agent WorkflowsAuto-check passed
  • Plugin Settings Pattern

    anthropics/claude-plugins-official

    Official

    Shows how Claude Code plugins keep per-project settings and state in .claude/plugin-name.local.md files with YAML frontmatter and a markdown body.

    38k GitHub starsUsed in 7 repos~3k tokens
    Agent WorkflowsAuto-check passed
  • MCP Integration for Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.

    38k GitHub starsUsed in 11 repos~3.1k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Command Development

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code slash commands: Markdown files with YAML frontmatter, arguments, file references, bash context and interactive prompts.

    38k GitHub starsUsed in 10 repos~4.8k tokens
    Agent WorkflowsAuto-check passed

More from pr-pm/prpm

All 35 skills in this repo
  • Reference for writing Claude Code agent files: location, frontmatter fields, validation limits, tool and model choices, and the required content format.

    122 GitHub starsUsed in 3 repos~4k tokens
    Auto-check passed
  • Shows how to write .claude/rules/ files correctly: paths frontmatter instead of globs, quoted glob patterns, global rules and conversion of Cursor rules.

    122 GitHub starsUsed in 2 repos~551 tokens
    Auto-check passed
  • Reference for writing portable Agent Skills packages, covering SKILL.md frontmatter limits, name rules, directory layout and where Codex CLI, GitHub Copilot and Amp look for skills.

    122 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • A skill your agent uses when building custom Kiro AI agents or when user asks for agent configurations - provides JSON structure, tool configuration, prompt patterns, and security best practices for…

    122 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • A skill your agent uses when creating OpenCode agents - provides markdown format with YAML frontmatter, mode/tools/permission configuration, and best practices for specialized AI assistants

    122 GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • A skill your agent uses when implementing Stripe webhook endpoints and getting 'Raw body not available' or signature verification errors - provides raw body parsing solutions and subscription period…

    122 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed

Categories

Questions about Creating Claude Code Hooks

What does Creating Claude Code Hooks do?

Covers how to build, configure and publish Claude Code hooks: event types, exit codes, JSON I/O, and PRPM packaging. claude/hooks/<event-name>, simpler but less configurable. Command hooks run an external script in milliseconds for formatting, logging or file checks, while prompt hooks use LLM reasoning over several seconds for complex validation or security analysis.

When should I use Creating Claude Code Hooks?

Creating Claude Code Hooks fits situations like: creating a new Claude Code hook; choosing between a command hook and a prompt hook; publishing a hook as a PRPM package; troubleshooting why a hook isn't firing or blocking as expected.

How do I install Creating Claude Code Hooks in Claude Code?

Run `npx skills add pr-pm/prpm --skill creating-claude-hooks -a claude-code`. Or copy the skill folder (.claude/skills/creating-claude-hooks in pr-pm/prpm) into .claude/skills/creating-claude-hooks in your project. Claude Code loads it when a task matches its description.

How do I install Creating Claude Code Hooks in Codex?

Run `npx skills add pr-pm/prpm --skill creating-claude-hooks -a codex`. Or copy the skill folder (.claude/skills/creating-claude-hooks in pr-pm/prpm) into .agents/skills/creating-claude-hooks in your project. Codex loads it when a task matches its description.

Can I use Creating Claude Code Hooks in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pr-pm/prpm --skill creating-claude-hooks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/creating-claude-hooks, .gemini/skills/creating-claude-hooks, .github/skills/creating-claude-hooks and .opencode/skills/creating-claude-hooks in your project.

What does Creating Claude Code Hooks need to run?

Going by SKILL.md and its folder, Creating Claude Code Hooks needs the command-line tools its instructions call (jq and prettier).

Does Creating Claude Code Hooks access the network?

SKILL.md names 1 domain. As links in the text: docs.claude.com. This is read from the text; nothing was executed.

Is Creating Claude Code Hooks safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Creating Claude Code Hooks use?

Creating Claude Code Hooks is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Creating Claude Code Hooks use?

About 3.9k tokens (SKILL.md is roughly 16k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Creating Claude Code Hooks?

Skills that share tags, products or a category with Creating Claude Code Hooks: Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Claude Code Agent Development (anthropics/claude-plugins-official, 38k stars), Claude Code Skill Developer Guide (diet103/claude-code-infrastructure-showcase, 10k stars) and Plugin Settings Pattern (anthropics/claude-plugins-official, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Creating Claude Code Hooks?

pr-pm (a GitHub organization) maintains it in pr-pm/prpm, which has 122 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 6, 2026.

Source: pr-pm/prpm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.