hook-recipes

hook-recipes is a skill for Claude Code from VersoXBT/claude-initial-setup. It costs 68 tokens per session (2,229 once invoked), scanned B, original, MIT.

A set of ready-made Claude Code hook examples for common development tasks. Hooks are commands that run automatically in response to events such as file edits or session end.

In plain words
What is it for?
Use it to auto-format files, run TypeScript checks, warn about debug code, review before a Git push, or block certain document files.
Why use it?
It saves time when you need a known automation pattern instead of designing the configuration yourself. The examples help catch issues or apply formatting during routine work.

Skill for Claude Code

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

Part of the claude-initial-setup plugin — 75 skills, 15 commands, 14 agents, 2 hooks shipped together

Good fit Use it to auto-format files, run TypeScript checks, warn about debug code, review before a Git push, or block certain document files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/versoxbt/claude-initial-setup/hook-recipes
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 VersoXBT/claude-initial-setup --skill hook-recipes
Clone the repo
git clone --depth 1 https://github.com/VersoXBT/claude-initial-setup

Made for: Claude Code.

Or install claude-initial-setup, the plugin that ships this one along with the rest of its 75 skills, 15 commands, 14 agents, 2 hooks.

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-recipes

README.md
[![agentmods](https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/hook-recipes/github.svg)](https://agentmods.dev/skills/versoxbt/claude-initial-setup/hook-recipes)
Your own site
<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/hook-recipes"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/hook-recipes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hook-recipes

Your own site · 80×15
<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/hook-recipes"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/hook-recipes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,229 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 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.00068 $0.02229
Opus 5.5 $0.00027 $0.00892
Sonnet 5.5 $0.00014 $0.00446
Haiku 4.5 $0.00007 $0.00223

Measured 1mo ago against content hash 81a45e591757, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

hook-recipes 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 1mo 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.

A collection of battle-tested hook configurations for Claude Code. Copy these directly into `~/.claude/settings.json` under the `hooks` key.
skills/hooks/hook-recipes/SKILL.md · 233 lines

How it starts

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

Hook Recipes

A collection of battle-tested hook configurations for Claude Code. Copy these directly into ~/.claude/settings.json under the hooks key.

When to Use

  • User asks for a specific hook recipe or example
  • User wants to auto-format code after edits
  • User wants to block certain file types from being created
  • User wants warnings about console.log, TODO, or debug statements
  • User needs a git push review gate
  • User asks "how do I set up hooks for X"

Core Recipes

Recipe 1: Prettier Auto-Format on Edit

Formats JavaScript, TypeScript, CSS, and JSON files after every edit or write:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "command": "if echo \"$CLAUDE_FILE_PATH\" | grep -qE '\\.(js|ts|jsx|tsx|css|scss|json|md)$'; then npx prettier --write \"$CLAUDE_FILE_PATH\" 2>/dev/null; fi",
        "description": "Prettier auto-format"
      }
    ]
  }
}

Recipe 2: TypeScript Type-Check After Edit

Runs tsc --noEmit after editing TypeScript files to catch type errors immediately:

{
  "matcher": "Edit|Write",
  "command": "if echo \"$CLAUDE_FILE_PATH\" | grep -qE '\\.tsx?$'; then npx tsc --noEmit --pretty 2>&1 | tail -20; fi",
  "description": "TypeScript type-check"
}

Recipe 3: Console.log Warning

Warns when a file containing console.log is edited. Does not block, just informs:

{
  "matcher": "Edit|Write",
  "command": "if echo \"$CLAUDE_FILE_PATH\" | grep -qE '\\.(js|ts|jsx|tsx)$'; then MATCHES=$(grep -n 'console\\.log' \"$CLAUDE_FILE_PATH\" 2>/dev/null); if [ -n \"$MATCHES\" ]; then echo \"WARNING: console.log found in $CLAUDE_FILE_PATH:\"; echo \"$MATCHES\" | head -5; fi; fi",
  "description": "Warn about console.log in edited files"
}

Recipe 4: Git Push Review Gate

Opens the diff for review before allowing a git push. Blocks the push so the user can inspect:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -q 'git push'; then echo '=== FILES TO BE PUSHED ===' && git diff --stat HEAD~1 && echo '' && echo 'Review the above changes. This hook will allow the push to proceed.'; fi",
        "description": "Show diff summary before git push"
      }
    ]
  }
}

Read the full file on GitHub · 233 lines

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. 1mo ago First seen · 233 lines · 68 tokens per session scan B 81a45e591757

Subscribe to this mod's changes

hook-recipes is a skill published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 5mo ago), licensed MIT. It adds 68 tokens to every session and 2,229 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

commit-trailers

Structured commit trailers — adds Constraint, Rejected, Scope-risk, and Not-tested metadata to commit messages. Captures architectural decisions and known gaps in git history.

XeldarAlz/everything-claude-unity · 37 tokens

git-advanced-workflows

Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.

wshobson/agents · 54 tokens

workflow-patterns

Use this skill when implementing tasks according to Conductor's TDD workflow, handling phase checkpoints, managing git commits for tasks, or understanding the verification protocol.

wshobson/agents · 35 tokens

what-did-i-get-done

Summarize authored commits over a user-specified time period into a concise update.

michael-denyer/pstack-claude · 24 tokens

block-no-verify-hook

Configure a PreToolUse hook to prevent AI agents from skipping git pre-commit hooks with --no-verify and other bypass flags. Use when setting up Claude Code projects that enforce commit quality gates.

wshobson/agents · 46 tokens

cross-repo-cache

Check if cross-repo coordinator results can be reused, avoiding redundant Sonnet agent launches. Compares peer repo git hashes against stored hashes from last coordinator run. Triggers on: entering Phase 1.4.1, checking cross-repo cache, before discovering peers. Returns CROSSREPOCACHEHIT with cached status or…

closedloop-ai/claude-plugins · 81 tokens