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.
/plugin marketplace add vinnie357/claude-skills/plugin install claude-codeWrote 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.
[](https://agentmods.dev/skills/vinnie357/claude-skills/claude-hooks)<a href="https://agentmods.dev/skills/vinnie357/claude-skills/claude-hooks"><img src="https://agentmods.dev/badge/skills/vinnie357/claude-skills/claude-hooks/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.
<a href="https://agentmods.dev/skills/vinnie357/claude-skills/claude-hooks"><img src="https://agentmods.dev/badge/skills/vinnie357/claude-skills/claude-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00048 | $0.01734 |
| Opus 5 | $0.00024 | $0.00867 |
| Sonnet 5 | $0.00010 | $0.00347 |
| Haiku 4.5 | $0.00005 | $0.00173 |
Grade D, and why
claude-hooks scanned grade D 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.
| User | `~/.claude/settings.json` under `hooks` | Personal automation across all projects | Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- Block destructive patterns in `PreToolUse` Bash hooks (`rm -rf /`, `dd if=`, force-push to protected branches). How it starts
The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Claude Code Hooks
Hooks are shell commands or prompts that Claude Code executes in response to events. They are the only mechanism that can compel behavior — Claude reads memory and skills as guidance, but the harness runs hooks, not Claude.
Hook Configuration Locations
| Scope | Path | Use case |
|---|---|---|
| User | ~/.claude/settings.json under hooks |
Personal automation across all projects |
| Project | <project>/.claude/settings.json under hooks |
Repo-shared automation |
| Plugin | <plugin-root>/hooks/hooks.json |
Distribute hooks via plugin install |
| Skill/Subagent | Skill or subagent frontmatter hooks: field |
Hooks registered by a skill or subagent invocation |
Plugin hooks at <plugin-root>/hooks/hooks.json are auto-discovered. No registration in plugin.json required.
Skill hooks: Claude Code registers them when you or Claude invoke the skill and keeps running them for the rest of the session, on turns after the skill's own turn as well. The practical consequence: the coverage gap is a session that never invokes the skill, not a session where the skill merely "isn't loaded" at the moment a tool runs.
Plugin Hook File Structure
Plugin hooks/hooks.json uses the wrapper format — see references/hook-examples.md ("Plugin hooks.json wrapper format") for the complete file.
description— optional, surfaced in plugin metadatahooks— required wrapper containing event arraysmatcher— regex of tool names (PreToolUse/PostToolUse) or session lifecycle phases (SessionStart)CLAUDE_PLUGIN_ROOT— absolute path to the plugin root, expanded at runtime. Written bare here (not as${...}) because the braced form itself expands when this skill loads — seereferences/hook-examples.mdfor the real brace-expansion usage.
Hook Events
| Event | When it fires | Common use |
|---|---|---|
SessionStart |
Session start, resume, clear | Inject binding context to turn 1 |
SessionEnd |
Session ends | Cleanup, telemetry |
UserPromptSubmit |
User submits a prompt | Augment prompt, log interaction |
PreToolUse |
Before a tool executes | Block dangerous calls, validate input |
PostToolUse |
After a tool completes | Format, lint, sync, log |
Stop |
Agent finishes responding | Enforce completion standards |
SubagentStop |
Spawned subagent finishes | Subagent-specific cleanup |
PreCompact |
Before context compaction | Inject context to preserve |
Notification |
A notification fires | Custom notification routing |
What ships with it
3 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.
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.
- 4d ago Changed · +2 lines ec2fbe1baae4
- 7d ago First seen · 160 lines · 48 tokens per session scan D c2ab12002418
claude-hooks is a skill published in the GitHub repository vinnie357/claude-skills (25 stars, last pushed yesterday), licensed MIT. It adds 48 tokens to every session and 1,734 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it D with 2 findings (reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
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…
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…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
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…