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.
npx skills add nimadorostkar/Claude-Skills-collection --skill hooksgit clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collectionWrote 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/nimadorostkar/claude-skills-collection/hooks)<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/hooks"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/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/nimadorostkar/claude-skills-collection/hooks"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/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.00095 | $0.01259 |
| Opus 5.5 | $0.00038 | $0.00504 |
| Sonnet 5.5 | $0.00019 | $0.00252 |
| Haiku 4.5 | $0.00010 | $0.00126 |
Grade C, and why
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 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
description: Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember, and avoiding hooks that make an agent unusable. Tr How it starts
The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hooks
Purpose
Enforce a rule deterministically rather than asking the model to remember it. A hook runs every time, regardless of the model's attention, its context, or its mood — which is exactly what a rule requires.
When to Use
- A rule must hold every time: formatting, a forbidden command, a required check.
- The agent keeps forgetting an instruction despite it being in the instructions.
- Automating a step that should happen around every edit or command.
- Blocking a dangerous action before it executes.
Capabilities
- Lifecycle events: before and after a tool call, on session start, on stop.
- Deterministic enforcement: formatting, linting, blocking.
- Injecting context at the right moment.
- Notification and logging.
Inputs
- The rule and when it must apply.
- The event that should trigger it.
- What should happen when it fails: block, warn, or fix.
Outputs
- Hook configuration that runs reliably.
- Rules enforced without depending on the model's memory.
- A fast hook — one that does not make the agent unpleasant to use.
Workflow
- Identify the rule that keeps being broken — If an instruction is in the instruction file and is still violated, it is a hook, not an instruction. Instructions are guidance; hooks are enforcement.
- Choose the event — Before a tool call to block or validate; after one to format or verify; on session start to inject context.
- Make it fast — A hook runs on every matching event. Two seconds on every file edit is a hostile environment. Under 500ms, or run it asynchronously.
- Fail informatively — A hook that blocks must say why and what to do instead. A silent block is maddening and the model cannot recover from it.
- Prefer fixing over blocking — A hook that formats the file is better than one that rejects the edit and demands the model format it.
- Test the hook itself — A broken hook blocks everything, and the failure mode is confusing.
Best Practices
- A rule the model must remember is a rule the model will eventually forget. If it matters, enforce it in a hook.
- Do not put slow operations in a synchronous hook. A full test suite on every edit is a way to make the agent unusable.
- Blocking hooks must explain themselves.
exit 2with an explanatory message on stderr is what lets the model correct course. - Match narrowly. A hook that fires on every tool call, including reads, wastes time on operations it does not care about.
- Auto-formatting after an edit is the single most valuable hook: it removes an entire class of diff noise and lint failures for free.
- Guard against the destructive command (
rm -rf, a force push, a production deploy) in a pre-tool hook. This is cheap insurance.
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.
- 1mo ago Changed · +56 tokens per session 0abad40a5006
- 3mo ago First seen · 115 lines · 39 tokens per session scan C b71372eccacb
hooks is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (41 stars, last pushed today), licensed MIT. It adds 95 tokens to every session and 1,259 once invoked, about $0.0004 per session on Opus 5.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-30.
hooks compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| hooksnimadorostkar/Claude-Skills-collection | Skill | 41 | today | MIT | C | 95 | Claude Code |
| offensive-c2-frameworksSnailSploit/Claude-Red | Skill | 12k | 13d ago | MIT | A | 250 | Claude Code, Codex |
| offensive-crypto-attacksSnailSploit/Claude-Red | Skill | 12k | 13d ago | MIT | A | 261 | Claude Code, Codex |
| offensive-parameter-pollutionSnailSploit/Claude-Red | Skill | 12k | 13d ago | MIT | A | 57 | Claude Code, Codex |
| offensive-z-waveSnailSploit/Claude-Red | Skill | 12k | 13d ago | MIT | A | 113 | Claude Code, Codex |
| fiscalisteromainsimon/paperasse | Skill | 2.6k | 17d ago | MIT | A | 306 | Claude Code |
| feature-prioritisationmohitagw15856/pm-claude-skills | Skill | 1.6k | today | MIT | A | 103 | Claude Code, Codex |