create-hooks

create-hooks is a skill for Claude Code from Vibe-Marketer/plugins-and-skills. It costs 121 tokens per session (1,999 once invoked), scanned C, original, MIT.

A setup guide for Claude Code hooks, which are actions that run when specific events happen during a coding session.

In plain words
What is it for?
Use it to configure command or prompt hooks, choose the events and tools they apply to, and test them with Claude's debug mode.
Why use it?
It removes the need to work out how to run checks, block risky commands, add context, or send notifications at the right time.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the create-plugins plugin — 12 skills, 6 commands, 9 agents shipped together

Good fit Use it to configure command or prompt hooks, choose the events and tools they apply to, and test them with Claude's debug mode.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Vibe-Marketer/plugins-and-skills
Claude Code
/plugin install create-plugins

Made for: Claude Code.

Or install create-plugins, the plugin that ships this one along with the rest of its 12 skills, 6 commands, 9 agents.

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 create-hooks

README.md
[![agentmods](https://agentmods.dev/badge/skills/vibe-marketer/plugins-and-skills/create-hooks.svg)](https://agentmods.dev/skills/vibe-marketer/plugins-and-skills/create-hooks)
Your own site
<a href="https://agentmods.dev/skills/vibe-marketer/plugins-and-skills/create-hooks"><img src="https://agentmods.dev/badge/skills/vibe-marketer/plugins-and-skills/create-hooks.svg" alt="Measured on agentmods" height="20"></a>
Per session 121 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,999 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00121 $0.01999
Opus 5 $0.00060 $0.01000
Sonnet 5 $0.00024 $0.00400
Haiku 4.5 $0.00012 $0.00200

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

Security

Grade C, and why

create-hooks scanned grade C 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 7d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

"prompt": "Check if this bash command is safe. Block destructive commands like rm -rf, git push --force, git reset --hard."
create-plugins/skills/create-hooks/SKILL.md · 219 lines

How it starts

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

<quick_start>

  1. Choose hook event (when it fires) and hook type (command or prompt)
  2. Create hooks config: .claude/hooks.json (project), ~/.claude/hooks.json (personal), or hooks/hooks.json (plugin)
  3. Configure matcher pattern for which tools trigger the hook
  4. Write hook command or prompt
  5. Test with claude --debug </quick_start>

<essential_principles> Prompt-based hooks (recommended) use LLM reasoning for context-aware decisions. They handle complex logic, natural language validation, and edge cases without bash scripting.

Command hooks execute deterministic shell commands. Use them for fast checks, logging, file operations, external tool integrations, and notifications.

Choose prompt hooks unless you need: speed (command hooks are faster), determinism (exact same behavior every time), or external tool execution (formatters, linters). </essential_principles>

Event When Can Block? Use For
PreToolUse Before tool runs Yes Validation, modification, blocking
PostToolUse After tool completes No Feedback, logging, formatting
UserPromptSubmit User sends prompt Yes Context injection, prompt validation
Stop Main agent stopping Yes Completeness verification
SubagentStop Subagent stopping Yes Subagent task validation
SessionStart Session begins No Context loading, env setup
SessionEnd Session ends No Cleanup, state preservation
PreCompact Before compaction Yes Preserve critical context
Notification Claude needs input No Desktop notifications, alerts

See references/hook-types.md for detailed input/output schemas per event. </step_1_choose_event>

<step_2_configure_matcher> Matchers filter which tools trigger the hook:

"matcher": "Bash"                    // Exact match
"matcher": "Write|Edit"              // Multiple tools (regex OR)
"matcher": "Read|Write|Edit"         // All file operations
"matcher": "mcp__.*"                 // All MCP tools
"matcher": "mcp__plugin_asana_.*"    // Specific MCP server
"matcher": "mcp__.*__delete.*"       // All MCP delete tools
"matcher": "*"                       // Wildcard (all tools)

No matcher = fires for all tools. Matchers are case-sensitive and use regex syntax.

See references/matchers.md for comprehensive patterns. </step_2_configure_matcher>

<step_3_write_hook> Prompt hook (LLM-evaluated):

{
  "type": "prompt",
  "prompt": "Evaluate if this tool use is appropriate. Check for [criteria]. Return 'approve' or 'block' with reason.",
  "timeout": 30
}

Supported on: PreToolUse, Stop, SubagentStop, UserPromptSubmit

Command hook (shell execution):

{
  "type": "command",
  "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh",
  "timeout": 60
}

Receives JSON via stdin, returns JSON via stdout.

Hook output for blocking events (PreToolUse):

{
  "hookSpecificOutput": {
    "permissionDecision": "allow|deny|ask",
    "updatedInput": {"field": "modified_value"}
  },
  "systemMessage": "Explanation for Claude"
}

Hook output for Stop/SubagentStop:

{
  "decision": "approve|block",
  "reason": "Explanation"
}

Exit codes: 0 = success (stdout in transcript), 2 = blocking error (stderr fed to Claude). </step_3_write_hook>

<step_4_assemble_config> Project/User hooks (.claude/hooks.json or ~/.claude/hooks.json):

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "prompt",
            "prompt": "Check if this bash command is safe. Block destructive commands like rm -rf, git push --force, git reset --hard."
          }
        ]
      }
    ]
  }
}

Read the full file on GitHub · 219 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. 7d ago First seen · 219 lines · 121 tokens per session scan C 549ed07e2197

Subscribe to this mod's changes

create-hooks is a skill published in the GitHub repository Vibe-Marketer/plugins-and-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 121 tokens to every session and 1,999 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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

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