agents-hooks

agents-hooks is a skill for Claude Code, Codex from vasilyu1983/AI-Agents-public. It costs 37 tokens per session (5,907 once invoked), scanned B, original, MIT.

A guide for configuring actions that run during Claude Code or Codex sessions, such as checks, notifications, and automated worktree tasks. Hooks are automatic callbacks triggered by events in an agent’s lifecycle.

In plain words
What is it for?
Use it to add guardrails, run preflight checks, verify work asynchronously, coordinate worktrees or subagents, and send Codex notifications.
Why use it?
It helps add safety checks, audit records, automated setup, and spending or tool-use limits at the right points in a session.

Skill for Claude CodeCodex

Written for Claude Code and Codex: SessionStart hook event, but also agents/openai.yaml present. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it to add guardrails, run preflight checks, verify work asynchronously, coordinate worktrees or subagents, and send Codex notifications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vasilyu1983/ai-agents-public/agents-hooks
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 vasilyu1983/AI-Agents-public --skill agents-hooks
Clone the repo
git clone --depth 1 https://github.com/vasilyu1983/AI-Agents-public

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/vasilyu1983/ai-agents-public/agents-hooks/github.svg)](https://agentmods.dev/skills/vasilyu1983/ai-agents-public/agents-hooks)
Your own site
<a href="https://agentmods.dev/skills/vasilyu1983/ai-agents-public/agents-hooks"><img src="https://agentmods.dev/badge/skills/vasilyu1983/ai-agents-public/agents-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.

agentmods 80×15 button for agents-hooks

Your own site · 80×15
<a href="https://agentmods.dev/skills/vasilyu1983/ai-agents-public/agents-hooks"><img src="https://agentmods.dev/badge/skills/vasilyu1983/ai-agents-public/agents-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,907 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 8 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Agent Snooping · line 13
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Tool Misuse · line 73
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 105
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 105
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Agent Snooping · line 115
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 202
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 273
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • medium MCP Rug Pull · line 340
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.00037 $0.05907
Opus 5 $0.00018 $0.02953
Sonnet 5 $0.00007 $0.01181
Haiku 4.5 $0.00004 $0.00591

Measured 12d ago against content hash 982aca81778c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

agents-hooks scanned grade B 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 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (assets/template-preflight-runtime-hook.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Claude and Codex are not equivalent here. Claude has a broad, stable hook system (31 events, re-verified against official docs 2026-08-15). Codex has two surfaces: the long-stable notification surface (`notify` + `tui.no

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Recursive force deletemediumDestructive command

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

| Block `rm -rf`, `git push --force`, `git add .` before they run | `PreToolUse` (matcher `Bash`) | `command` | [`references/hook-templates.md`](references/hook-templates.md), patterns §8/§11 |

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

frameworks/shared-skills/skills/agents-hooks/SKILL.md · 419 lines

How it starts

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

Claude Code Hooks + Codex Notifications

Use this skill when hook behavior is the main concern: Claude lifecycle hooks, runtime preflight, guardrails, async verification, worktree lifecycle checks, subagent coordination, or Codex notification callbacks.

Claude and Codex are not equivalent here. Claude has a broad, stable hook system (31 events, re-verified against official docs 2026-08-15). Codex has two surfaces: the long-stable notification surface (notify + tui.notifications), and a newer lifecycle-hooks system (hooks.json with events including SessionStart, UserPromptSubmit, SubagentStop, Stop, PreCompact/PostCompact — see developers.openai.com/codex/hooks). The Codex hooks system is less mature than Claude's and has known firing-reliability gaps (e.g. codex#17532: repo-local .codex/config.toml hooks may not fire in interactive sessions). Prefer notify for anything that must be dependable; treat Codex hooks.json as usable-but-verify and confirm it fires on your runtime before relying on it.

Quick Reference

Need Event / Approach
enforce pre-tool policy or guardrails PreToolUse command hook
fast runtime checks at session start SessionStart or Setup
react to user prompt before Claude sees it UserPromptSubmit
run checks after edits (non-blocking) PostToolUse (async/background)
catch tool failures separately PostToolUseFailure
check after a full batch of parallel tool calls PostToolBatch
inject context into or coordinate subagents SubagentStart / SubagentStop
transform what the user sees (not the transcript) MessageDisplay
persist compact durable state before compaction PreCompact
react after compaction completes PostCompact
handle worktree setup and teardown WorktreeCreate / WorktreeRemove
react to cd or watched file changes CwdChanged / FileChanged
keep agent team from going idle TeammateIdle
handle API errors at turn end StopFailure
reload plugin hooks safely atomic clear-then-register swap
add Codex callback behavior notify external program plus tui.notifications
enforce budgets, iteration caps, stagnation, kill-switches references/budget-and-loop-hooks.md

Read the full file on GitHub · 419 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. 12d ago First seen · 419 lines · 37 tokens per session scan B 982aca81778c

Subscribe to this mod's changes

agents-hooks is a skill published in the GitHub repository vasilyu1983/AI-Agents-public (87 stars, last pushed 10d ago), licensed MIT. It adds 37 tokens to every session and 5,907 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B 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-08-30.

Related

Other skills, from other repositories

nft-standards

Implement NFT standards (ERC-721, ERC-1155) with proper metadata handling, minting strategies, and marketplace integration. Use when creating NFT contracts, building NFT marketplaces, or implementing digital asset systems.

wshobson/agents · 48 tokens

istio-traffic-management

Configure Istio traffic management including routing, load balancing, circuit breakers, and canary deployments. Use when implementing service mesh traffic policies, progressive delivery, or resilience patterns.

wshobson/agents · 40 tokens

projection-patterns

Build read models and projections from event streams. Use when implementing CQRS read sides, building materialized views, or optimizing query performance in event-sourced systems.

wshobson/agents · 36 tokens

microservices-patterns

Design microservices architectures with service boundaries, event-driven communication, and resilience patterns. Use when building distributed systems, decomposing monoliths, or implementing microservices.

wshobson/agents · 38 tokens

track-management

Use this skill when creating, managing, or working with Conductor tracks - the logical work units for features, bugs, and refactors. Applies to spec.md, plan.md, and track lifecycle operations.

wshobson/agents · 44 tokens

make-pr-easy-to-review

Prepare PRs for review by cleaning noisy history, improving PR descriptions, and adding reviewer guidance without changing code behavior. Use for "make this easy to review", "tidy this PR", "clean up commits", or "annotate the diff".

michael-denyer/pstack-claude · 57 tokens