hook-creator

hook-creator is a skill for Claude Code from joonlab/joonlab-claudecode-setting-for-share. It costs 83 tokens per session (660 once invoked), scanned B, a copy of hook-creator, MIT.

A guide for creating Claude Code hooks, which are shell commands that run automatically at selected points during an agent session.

In plain words
What is it for?
Use it to configure commands before or after tools run, match specific tools or all tools, read event data, and store hooks in user or project settings.
Why use it?
It removes repetitive manual actions around tool use, such as formatting files, recording activity, sending notifications, or checking permissions.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Use it to configure commands before or after tools run, match specific tools or all tools, read event data, and store hooks in user or project settings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joonlab/joonlab-claudecode-setting-for-share/hook-creator
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.

Any agent
npx skills add joonlab/joonlab-claudecode-setting-for-share --skill hook-creator
Clone the repo
git clone --depth 1 https://github.com/joonlab/joonlab-claudecode-setting-for-share

Made for: Claude Code.

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/joonlab/joonlab-claudecode-setting-for-share/hook-creator.svg)](https://agentmods.dev/skills/joonlab/joonlab-claudecode-setting-for-share/hook-creator)
Your own site
<a href="https://agentmods.dev/skills/joonlab/joonlab-claudecode-setting-for-share/hook-creator"><img src="https://agentmods.dev/badge/skills/joonlab/joonlab-claudecode-setting-for-share/hook-creator.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 660 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.1 $0.00083 $0.00660
Opus 5 $0.00042 $0.00330
Sonnet 5 $0.00017 $0.00132
Haiku 4.5 $0.00008 $0.00066

Measured 8d ago against content hash d046588831ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade B, and why

hook-creator scanned grade B with 1 finding 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 8d 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`) or project (`.claude/settings.json`)
Origin

This is a copy

100% identical to hook-creator — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

claude/skills/hook-creator/SKILL.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 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>"
          }
        ]
      }
    ]
  }
}

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

Auto-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)"

Read the full file on GitHub · 89 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. 8d ago First seen · 89 lines · 83 tokens per session scan B d046588831ca

Subscribe to this mod's changes

hook-creator is a skill published in the GitHub repository joonlab/joonlab-claudecode-setting-for-share (10 stars, last pushed 29d ago), licensed MIT. It adds 83 tokens to every session and 660 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). It is 100% identical to hook-creator, differing in 0 lines, and is treated as a copy.

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

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens