agent-hooks

agent-hooks is a skill for Claude Code from bengous/claude-code-plugins. It costs 127 tokens per session (2,671 once invoked), scanned B, original, MIT.

A skill for setting up and checking agent-hooks in a repository. It explains how repository configuration connects automatic fixers, checks and safeguards to Claude Code or Codex.

In plain words
What is it for?
Use it to initialise the hooks kit, run its health check, configure repository participation and inspect how work is landed, including worktrees.
Why use it?
It helps avoid duplicated hook configuration and catches incompatible versions or invalid settings before they cause confusing failures.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the agent-hooks plugin — 1 skill, 1 hook shipped together

Good fit Use it to initialise the hooks kit, run its health check, configure repository participation and inspect how work is landed, including worktrees.

Compare 6 skills from other repositories ↓
Install

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.

Claude Code
/plugin marketplace add bengous/claude-code-plugins
Claude Code
/plugin install agent-hooks

Made for: Claude Code.

Or install agent-hooks, the plugin that ships this one along with the rest of its 1 skill, 1 hook.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/bengous/claude-code-plugins/agent-hooks/github.svg)](https://agentmods.dev/skills/bengous/claude-code-plugins/agent-hooks)
Your own site
<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.

agentmods 80×15 button for agent-hooks

Your own site · 80×15
<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>
Per session 127 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,671 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 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.00127 $0.02671
Opus 5.5 $0.00051 $0.01068
Sonnet 5.5 $0.00025 $0.00534
Haiku 4.5 $0.00013 $0.00267

Measured 4d ago against content hash cd9a682b37c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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
agent-hooks/skills/agent-hooks/SKILL.md · 138 lines

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

  1. 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.
  2. Write .claude/agent-hooks.jsonc once the user agrees; the kit never writes it.
  3. Run ${CLAUDE_PLUGIN_ROOT}/agent-hooks.ts doctor from the repository and fix every MISSING and FAIL line before the first turn; a WARN line (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.
  4. When sessions run in worktrees, declare the directories a worktree shares with the main checkout, such as node_modules, in Claude Code's own setting worktree.symlinkDirectories (paths relative to the repository's top) in the main checkout's .claude/settings.json or .claude/settings.local.json; ~/.claude/settings.json is 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 .gitignore with a pattern without a trailing slash (node_modules, not node_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 in node_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" }
  }
}

Read the full file on GitHub · 138 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. 4d ago Changed · +25 lines · +21 tokens per session scan A → B cd9a682b37c7
  2. 7d ago Changed · -250 lines · -67 tokens per session 49e7de99ea7e
  3. 27d ago Changed · +60 lines · +39 tokens per session 47da7abed8bb
  4. 1mo ago Changed · +1 lines eca21624a5fb
  5. 1mo ago Changed · -22 lines · -2 tokens per session 2d94ce5c27a4
  6. 1mo ago Changed · +30 lines 2f275aa22055
  7. 1mo ago Changed · +65 lines · +13 tokens per session 4e8905b6c7c0
  8. 1mo ago First seen · 229 lines · 123 tokens per session scan A 6d4a2ad9fe75

Subscribe to this mod's changes

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.

Related

agent-hooks compared with skills from other repositories

agent-hooks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-hooksbengous/claude-code-pluginsSkill6todayMITB127Claude Code
flow-next-landgmickel/flow-nextSkill735yesterdayMITA35Claude Code, Codex
flow-next-worktree-kitgmickel/flow-nextSkill735yesterdayMITA43Claude Code, Codex
development-workflowathola/claude-night-marketSkill358todayMITA20Claude Code
stepwise-task-executionmakifbaysal/tasktrooperSkill123yesterdayApache-2.0A33Claude Code, Codex
retroRune-kit/runeSkill96yesterdayMITA57Claude Code
github-clizhinjs/zhinSkill136todayMITA30Claude Code, Codex