hook-safety-review

hook-safety-review is a skill for Claude Code from yeaight7/agent-powerups. It costs 58 tokens per session (859 once invoked), scanned A, original, Apache-2.0.

A security review workflow for hooks, which are commands that run automatically when an agent event or Git event occurs. It checks the command, trigger, matching rules, and the files, environment, and network it can reach.

In plain words
What is it for?
Use it before enabling or changing an agent lifecycle hook, Git pre-commit or pre-push hook, or hook copied from outside the project.
Why use it?
Automatic commands can run with the agent's permissions without another person reviewing each run. Reviewing them first helps catch command injection, data leaks, and silent failures.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the security-guardrails plugin — 5 skills, 1 agent shipped together

Good fit Use it before enabling or changing an agent lifecycle hook, Git pre-commit or pre-push hook, or hook copied from outside the project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yeaight7/agent-powerups/hook-safety-review
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 yeaight7/agent-powerups --skill hook-safety-review
Clone the repo
git clone --depth 1 https://github.com/yeaight7/agent-powerups

Made for: Claude Code.

Or install security-guardrails, the plugin that ships this one along with the rest of its 5 skills, 1 agent.

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-safety-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/yeaight7/agent-powerups/hook-safety-review/github.svg)](https://agentmods.dev/skills/yeaight7/agent-powerups/hook-safety-review)
Your own site
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/hook-safety-review"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/hook-safety-review/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-safety-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/hook-safety-review"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/hook-safety-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 859 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00058 $0.00859
Opus 5.5 $0.00023 $0.00344
Sonnet 5.5 $0.00012 $0.00172
Haiku 4.5 $0.00006 $0.00086

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

Security

Grade A, and why

hook-safety-review scanned grade A 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

rg -n 'curl|wget|nc |Invoke-WebRequest|Invoke-RestMethod' <hook-file>
plugins/security-guardrails/skills/hook-safety-review/SKILL.md · 75 lines

How it starts

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

Purpose

Review a hook definition before it is enabled so command injection, data exfiltration, and silent failure cannot ride in on automation. Hooks run automatically with the agent's privileges; a malicious or sloppy hook executes without any further review once it is on.

When to Use

  • A hook recipe (safety, quality, productivity) is a candidate for activation
  • An agent settings file gains or changes a lifecycle hook entry
  • A git pre-commit or pre-push hook is added or edited
  • A hook snippet arrives from outside the repo

Do not use for broad agent-config audits — that is the agent-config-security-audit skill. This skill is the enablement gate for one hook at a time.

Inputs

  • The hook definition: command body, trigger event, matcher pattern
  • The settings or recipe file that declares it
  • What the hook can reach: environment variables, file paths, network

Workflow

  1. Inventory the trigger surface. Identify the event (pre-tool, post-tool, session start, commit), the matcher pattern, and how often it fires. A catch-all matcher on a high-frequency event deserves the strictest review.

  2. Scan for command injection. Any user- or model-controlled value interpolated into a shell string is a P0 until proven bounded:

    rg -n '\$\{?[A-Za-z_]+\}?|\$\(|`' <hook-file>        # interpolation and substitution
    rg -n 'eval|sh -c|bash -c|Invoke-Expression' <hook-file>
    
  3. Scan for outbound network. Hooks should not phone home:

    rg -n 'curl|wget|nc |Invoke-WebRequest|Invoke-RestMethod' <hook-file>
    

    Any hit needs a documented justification and explicit user approval.

  4. Scan for silent failure. Error suppression hides both bugs and attacks:

    rg -n '\|\| true|2>/dev/null|2>\$null|exit 0' <hook-file>
    

    A hook that swallows its own failures cannot be trusted to gate anything.

  5. Check scope and privilege. Does the body read or write outside the repo? Does it touch credentials, dotfiles, or agent config? Flag absolute paths and home-directory access.

Read the full file on GitHub · 75 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 · 75 lines · 58 tokens per session scan A 395a4049fea1

Subscribe to this mod's changes

hook-safety-review is a skill published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 19d ago), licensed Apache-2.0. It adds 58 tokens to every session and 859 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.

Related

Other skills, from other repositories