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 bengous/claude-code-plugins/plugin install agent-hooksWrote 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/bengous/claude-code-plugins/agent-hooks)<a href="https://agentmods.dev/skills/bengous/claude-code-plugins/agent-hooks"><img src="https://agentmods.dev/badge/skills/bengous/claude-code-plugins/agent-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/bengous/claude-code-plugins/agent-hooks"><img src="https://agentmods.dev/badge/skills/bengous/claude-code-plugins/agent-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.00127 | $0.02671 |
| Opus 5.5 | $0.00051 | $0.01068 |
| Sonnet 5.5 | $0.00025 | $0.00534 |
| Haiku 4.5 | $0.00013 | $0.00267 |
Grade B, and why
agent-hooks scanned grade B 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 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.
`.claude/settings.json` or `.claude/settings.local.json`; `~/.claude/settings.json` is not read for How it starts
The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.
agent-hooks
The plugin's hooks/hooks.json wires SessionStart, PreToolUse Edit|Write, Stop and SubagentStop to
${CLAUDE_PLUGIN_ROOT}/agent-hooks.ts. A git checkout opts in with one file at its top,
.claude/agent-hooks.jsonc; anywhere else every hook exits at once, silently. One config per checkout:
a config in a subdirectory or outside git is never read. Never declare the kit's hooks in a settings
file as well: they would run twice.
Set-up
- Read what the repository already runs (package scripts, formatter and linter configs, CI) and draft the config with the user: fixers for what may rewrite a file, lanes for what checks.
- Write
.claude/agent-hooks.jsonconce the user agrees; the kit never writes it. - Run
${CLAUDE_PLUGIN_ROOT}/agent-hooks.ts doctorfrom the repository and fix everyMISSINGandFAILline before the first turn; aWARNline (a wiring to correct, a fixer the probes had no time to try, a linter that leaves a finding in a tracked file) never fails it. - When sessions run in worktrees, declare the directories a worktree shares with the main checkout,
such as
node_modules, in Claude Code's own settingworktree.symlinkDirectories(paths relative to the repository's top) in the main checkout's.claude/settings.jsonor.claude/settings.local.json;~/.claude/settings.jsonis not read for it. The kit links them only in a worktree that holds.claude/agent-hooks.jsonc, so commit that file. Ignore each in the repository's.gitignorewith a pattern without a trailing slash (node_modules, notnode_modules/): to git a link is a file. Declare only a directory a session reads and runs from, never one the repository's own scripts install or build into in each checkout: a write into it (an install, a build) lands in the main checkout, and a relative link inside it (a workspace package innode_modules) resolves to the main checkout's files, not the worktree's.
Config
{
"exclude": ["**/node_modules/**"], // generated or vendored: no fixer touches them, no `files` lane is handed them
"cap": 3, // blocks in a row, within one turn, before the Stop lets it end
"fixers": {
"oxlint": { "on": "**/*.{ts,tsx}", "file": "oxlint --fix --quiet {file}", "loop": true },
"prettier": { "on": "**/*.{ts,md}", "exclude": ["plans/**"], "stdin": "prettier --stdin-filepath {path}", "at": "both" }
},
"lanes": {
"lint": { "on": "**/*.ts", "takes": "files", "run": "oxlint --format=unix {files}", "timeout": 60 },
"clippy": { "on": "**/*.rs", "takes": "project", "cwd": "pkg", "run": "cargo clippy", "verdict": "note" }
}
}
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 · +25 lines · +21 tokens per session scan A → B cd9a682b37c7
- 7d ago Changed · -250 lines · -67 tokens per session 49e7de99ea7e
- 27d ago Changed · +60 lines · +39 tokens per session 47da7abed8bb
- 1mo ago Changed · +1 lines eca21624a5fb
- 1mo ago Changed · -22 lines · -2 tokens per session 2d94ce5c27a4
- 1mo ago Changed · +30 lines 2f275aa22055
- 1mo ago Changed · +65 lines · +13 tokens per session 4e8905b6c7c0
- 1mo ago First seen · 229 lines · 123 tokens per session scan A 6d4a2ad9fe75
agent-hooks is a skill published in the GitHub repository bengous/claude-code-plugins (6 stars, last pushed today), licensed MIT. It adds 127 tokens to every session and 2,671 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-19.
agent-hooks compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| agent-hooksbengous/claude-code-plugins | Skill | 6 | today | MIT | B | 127 | Claude Code |
| flow-next-landgmickel/flow-next | Skill | 735 | yesterday | MIT | A | 35 | Claude Code, Codex |
| flow-next-worktree-kitgmickel/flow-next | Skill | 735 | yesterday | MIT | A | 43 | Claude Code, Codex |
| development-workflowathola/claude-night-market | Skill | 358 | today | MIT | A | 20 | Claude Code |
| stepwise-task-executionmakifbaysal/tasktrooper | Skill | 123 | yesterday | Apache-2.0 | A | 33 | Claude Code, Codex |
| retroRune-kit/rune | Skill | 96 | yesterday | MIT | A | 57 | Claude Code |
| github-clizhinjs/zhin | Skill | 136 | today | MIT | A | 30 | Claude Code, Codex |