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 agentmods add skills/agent-sh/agentsys/enhance-hooksnpx skills add agent-sh/agentsys --skill enhance-hooksgit clone --depth 1 https://github.com/agent-sh/agentsysWrote 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/agent-sh/agentsys/enhance-hooks)<a href="https://agentmods.dev/skills/agent-sh/agentsys/enhance-hooks"><img src="https://agentmods.dev/badge/skills/agent-sh/agentsys/enhance-hooks.svg" alt="Measured on agentmods" 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 | $0.00019 | $0.03436 |
| Opus 5 | $0.00010 | $0.01718 |
| Sonnet 5 | $0.00004 | $0.00687 |
| Haiku 4.5 | $0.00002 | $0.00344 |
Grade F, and why
enhance-hooks scanned grade F with 4 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 5d 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.
Downloads and executes remote codehighSupply chain
curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.
| `curl \| sh` | Remote code execution | HIGH | Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
| User settings | `~/.claude/settings.json` | All projects | No | Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
if echo "$cmd" | grep -qE 'rm -rf|git reset --hard|curl.*\|.*sh'; then Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
if echo "$cmd" | grep -qE 'rm -rf|git reset --hard|curl.*\|.*sh'; then How it starts
The opening of the file, as written. The whole thing — 555 lines — stays where its author put it; the contents beside it link to each section on GitHub.
enhance-hooks
Analyze hook definitions and scripts for safety, correctness, and best practices.
Parse Arguments
const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const targetPath = args.find(a => !a.startsWith('--')) || '.';
const fix = args.includes('--fix');
Workflow
- Discover - Find hook files (.md, .sh, .json)
- Classify - Identify hook type and event
- Parse - Extract frontmatter and script content
- Check - Run all pattern checks against knowledge below
- Filter - Apply certainty filtering
- Report - Generate markdown output
- Fix - Apply auto-fixes if --fix flag present
Hook Knowledge Reference
What Are Hooks
Hooks are automated actions triggered at specific points in a Claude Code session. They enable validation, monitoring, and control of Claude's actions through bash commands or LLM-based evaluation.
Hook Lifecycle (Complete Reference)
Hooks fire in this sequence:
| Order | Event | Description | Matcher Required |
|---|---|---|---|
| 1 | SessionStart |
Session begins or resumes | No |
| 2 | UserPromptSubmit |
User submits a prompt | No |
| 3 | PreToolUse |
Before tool execution (can modify/block) | Yes |
| 4 | PermissionRequest |
When permission dialog appears | Yes |
| 5 | PostToolUse |
After tool succeeds | Yes |
| 6 | SubagentStart |
When spawning a subagent | No |
| 7 | SubagentStop |
When subagent finishes | No |
| 8 | Stop |
Claude finishes responding | No |
| 9 | PreCompact |
Before context compaction | No |
| 10 | SessionEnd |
Session terminates | No |
| 11 | Notification |
Claude Code sends notifications | No |
Hook Types
Command Hooks (type: "command"):
- Execute bash commands with full stdin/stdout control
- Available for all events
Prompt Hooks (type: "prompt"):
- Use LLM evaluation for intelligent, context-aware decisions
- Only supported for
StopandSubagentStopevents
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.
- 5d ago First seen · 555 lines · 19 tokens per session scan F 37fa54f06d36
enhance-hooks is a skill published in the GitHub repository agent-sh/agentsys (982 stars, last pushed yesterday), licensed MIT. It adds 19 tokens to every session and 3,436 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it F with 4 findings (downloads and executes remote code, 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.
Other skills, from other repositories
autopilot
Full autonomous execution from idea to working code.
ralplan
Consensus planning entrypoint that auto-gates vague ralph/autopilot/team requests before execution.
deep-interview
Socratic deep interview with mathematical ambiguity gating before explicit execution approval.
remember
Review reusable project knowledge and decide what belongs in project memory, notepad, or durable docs.
hud
Configure HUD display options (layout, presets, display elements).
plannotator-annotate
Open Plannotator's annotation UI for a file, folder, or URL, then address the returned annotations.