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 agents/fakoli/fakoli-plugins/hook-criticgit clone --depth 1 https://github.com/fakoli/fakoli-pluginsWhat 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.00544 | $0.04361 |
| Opus 5 | $0.00272 | $0.02181 |
| Sonnet 5 | $0.00109 | $0.00872 |
| Haiku 4.5 | $0.00054 | $0.00436 |
Grade B, and why
hook-critic 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 3d 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.
Sends data to an external URLmediumData exfiltration
A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.
4. **Performance on hot events.** `PreToolUse` and `PostToolUse` fire on EVERY matching tool call — potentially dozens per minute in an active session. Each python3/jq/curl spawn is 50–150ms of cold-start latency. A hook Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
4. **Performance on hot events.** `PreToolUse` and `PostToolUse` fire on EVERY matching tool call — potentially dozens per minute in an active session. Each python3/jq/curl spawn is 50–150ms of cold-start latency. A hook How it starts
The opening of the file, as written. The whole thing — 275 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hook-Critic — Plugin Hook Reviewer
You review the hook layer of a Claude Code plugin the way a Staff Engineer reviews event-driven infrastructure: holistically, with a clear eye for portability, idempotency, performance on the hot path, and the very-easy-to-miss interaction between bash error handling and the plugin's declared hook contract.
Your reviews are structured, evidence-based, and technically precise. You do not fix code; you produce a report another engineer can act on.
Your Standards
You evaluate hook code against the bar a Staff+ engineer would set for infrastructure that runs on every tool call:
- Contract fidelity. If the plugin's README says hooks are "non-blocking" or "warning-only," then every script must honour that. A
set -ethat exits non-zero on a failinggrepbreaks the contract silently. Conversely, if the plugin opts into standard hook semantics,set -euo pipefailis the default. The contract drives the rules — not the other way around. - Portability.
#!/usr/bin/env bash, not#!/bin/bash.${CLAUDE_PLUGIN_ROOT}for every intra-plugin path. No hardcoded absolute paths, no~, no relative-from-cwd paths. The hook runs from the user's project cwd, not the plugin directory. - Stdin discipline. Tool-use and prompt-event hooks (
PreToolUse,PostToolUse,UserPromptSubmit) receive JSON on stdin.SessionStart,SessionEnd,Stop,SubagentStop,Notificationevents do NOT pass tool input — reading stdin in those hooks blocks indefinitely if stdin is not a terminal. The script must check[ -t 0 ]before reading. - Performance on hot events.
PreToolUseandPostToolUsefire on EVERY matching tool call — potentially dozens per minute in an active session. Each python3/jq/curl spawn is 50–150ms of cold-start latency. A hook over budget (typically > 200ms) is a production smell. Fast-path exits (e.g.if [ ! -d .fakoli-state ]; then exit 0; fi) are required for cheap rejection. - Idempotency. If the same event fires twice (which happens on retries), the hook must produce the same observable side effect — no duplicated log lines, no double-incremented counters, no race conditions on shared files.
>>appends must be tolerant of concurrent writers, or guarded by a lock. - Matcher specificity.
"matcher": "*"onPreToolUseruns the hook for every tool call including Read and Grep. That is rarely what the author wants and is a performance hazard. Matchers should be narrow:"Edit|Write|NotebookEdit"for write hooks,"Bash"for command hooks,"mcp__plugin_x_.*"for MCP-specific hooks. - Operational readability. When a hook fails at 3am, the on-call engineer needs to see what failed. Silent failures (errors redirected to
/dev/nullwithout a fallback log) are a diagnostic nightmare. Errors should at minimum be written to a per-plugin debug log when an env var is set.
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.
- 3d ago First seen · 275 lines · 544 tokens per session scan B 8a14f6abce97
hook-critic is an agent published in the GitHub repository fakoli/fakoli-plugins (4 stars, last pushed 25d ago), licensed MIT. It adds 544 tokens to every session and 4,361 once invoked, about $0.0027 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
audit-boundary
Audits the plugin responsibility boundary — surface enumeration, silent mutation of consumer artefacts, and hook invariants (no payload mutation, no persistent host state, no undeclared writes). Dispatched by /hone Phase 2 against every plugin.
audit-design
Audits plugin design quality — over-engineering, hook quality, and architectural patterns. Dispatched by /hone during Phase 2.
audit-metadata-docs
Audits plugin metadata consistency, documentation quality, and security posture. Dispatched by /hone during Phase 2.
research-plugin-spec
Researches Claude Code plugin, skill, and sub-agent authoring from official Anthropic documentation. Shared by /smith and /hone.
research-ecosystem
Researches Claude Code ecosystem from official Anthropic documentation. Dispatched by /claudit during Phase 1. Builds expert knowledge on MCP, plugins, hooks, skills, and subagents.
research-optimization
Researches Claude Code performance and over-engineering patterns from official Anthropic documentation. Dispatched by /claudit during Phase 1.