hook-creator

hook-creator is a skill for Claude Code, Codex from GzuPark/claude-plugin-pack. It costs 105 tokens per session (1,616 once invoked), scanned B, original, MIT.

A guide for creating Claude Code hooks, which run commands automatically when events such as tool use, session start, or user input occur.

In plain words
What is it for?
Adding automatic formatting, logging, notifications, file protection, permission checks, and other actions before or after Claude Code events.
Why use it?
It helps configure these automatic actions correctly, including when they run, which tools they match, and where the settings are stored.

Skill for Claude CodeCodex

Part of the creators plugin — 4 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/gzupark/claude-plugin-pack/hook-creator
Any agent
npx skills add GzuPark/claude-plugin-pack --skill hook-creator
Clone the repo
git clone --depth 1 https://github.com/GzuPark/claude-plugin-pack

Made for: Claude Code, Codex.

Or install creators, the plugin that ships this one along with the rest of its 4 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hook-creator

README.md
[![agentmods](https://agentmods.dev/badge/skills/gzupark/claude-plugin-pack/hook-creator.svg)](https://agentmods.dev/skills/gzupark/claude-plugin-pack/hook-creator)
Your own site
<a href="https://agentmods.dev/skills/gzupark/claude-plugin-pack/hook-creator"><img src="https://agentmods.dev/badge/skills/gzupark/claude-plugin-pack/hook-creator.svg" alt="Measured on agentmods" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,616 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00105 $0.01616
Opus 5 $0.00053 $0.00808
Sonnet 5 $0.00021 $0.00323
Haiku 4.5 $0.00011 $0.00162

Measured 4d ago against content hash 80f52ab9da43, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

hook-creator scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

5. **Choose storage location** - User settings (`~/.claude/settings.json`)

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

(Slack, Discord, webhooks) via curl or custom scripts
plugins/creators/skills/hook-creator/SKILL.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hook Creator

Create Claude Code hooks that execute shell commands at specific lifecycle events.

Hook Creation Workflow

  1. Identify the use case - Determine what the hook should accomplish
  2. Select the appropriate event - Choose from available hook events (see references/hook-events.md)
  3. Design the hook command - Write shell command that processes JSON input from stdin
  4. Configure the matcher - Set tool/event filter (use * for all, or specific tool names like Bash, Edit|Write)
  5. Choose storage location - User settings (~/.claude/settings.json) or project (.claude/settings.json)
  6. Test the hook - Verify behavior with a simple test case

Hook Configuration Structure

{
  "hooks": {
    "<EventName>": [
      {
        "matcher": "<ToolPattern>",
        "hooks": [
          {
            "type": "command",
            "command": "<shell-command>",
            "once": true
          }
        ]
      }
    ]
  }
}

Hook Types

  • type: "command" - Execute shell command (default)
  • type: "prompt" - LLM-based evaluation. Supported for: Stop, SubagentStop, UserPromptSubmit, PreToolUse, PermissionRequest

Hook Options

  • once - Run only once per session (optional, default: false)

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 proceed
  • 2 - Block the tool and provide feedback to Claude

Matcher Patterns

  • * - Match all tools
  • Bash - Match only Bash tool
  • Edit|Write - Match Edit or Write tools
  • Read - Match Read tool

Quick Examples

Log all bash commands:

jq -r '"\(.tool_input.command)"' >> ~/.claude/bash-log.txt

Read the full file on GitHub · 236 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 236 lines · 105 tokens per session scan B 80f52ab9da43

Subscribe to this mod's changes

hook-creator is a skill published in the GitHub repository GzuPark/claude-plugin-pack (6 stars, last pushed 7mo ago), licensed MIT. It adds 105 tokens to every session and 1,616 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens