hook-critic

hook-critic is an agent for Claude Code from fakoli/fakoli-plugins. It costs 544 tokens per session (4,361 once invoked), scanned B, original, MIT.

A read-only review agent for the hook layer of a Claude Code plugin. Hooks are scripts that run automatically when specified events occur, such as tool calls.

In plain words
What is it for?
Reviewing hooks.json and its shell scripts, checking paths and shebangs, and assessing error handling and behavior on frequently triggered events.
Why use it?
It identifies portability, input-handling, performance, idempotency, and contract problems in event-driven plugin infrastructure before they cause failures.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter; mentions CLAUDE.md; names the NotebookEdit tool.

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 fakoli-plugin-critic plugin — 1 skill, 5 agents shipped together

Good fit Reviewing hooks.json and its shell scripts, checking paths and shebangs, and assessing error handling and behavior on frequently triggered events.

Compare 6 agents 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 fakoli/fakoli-plugins
Claude Code
/plugin install fakoli-plugin-critic

Made for: Claude Code.

Or install fakoli-plugin-critic, the plugin that ships this one along with the rest of its 1 skill, 5 agents.

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 hook-critic

README.md
[![agentmods](https://agentmods.dev/badge/agents/fakoli/fakoli-plugins/hook-critic/github.svg)](https://agentmods.dev/agents/fakoli/fakoli-plugins/hook-critic)
Your own site
<a href="https://agentmods.dev/agents/fakoli/fakoli-plugins/hook-critic"><img src="https://agentmods.dev/badge/agents/fakoli/fakoli-plugins/hook-critic/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 hook-critic

Your own site · 80×15
<a href="https://agentmods.dev/agents/fakoli/fakoli-plugins/hook-critic"><img src="https://agentmods.dev/badge/agents/fakoli/fakoli-plugins/hook-critic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 544 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,361 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.
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.00544 $0.04361
Opus 5.5 $0.00218 $0.01744
Sonnet 5.5 $0.00109 $0.00872
Haiku 4.5 $0.00054 $0.00436

Measured 1mo ago against content hash 8a14f6abce97, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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
plugins/fakoli-plugin-critic/agents/hook-critic.md · 275 lines

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:

  1. Contract fidelity. If the plugin's README says hooks are "non-blocking" or "warning-only," then every script must honour that. A set -e that exits non-zero on a failing grep breaks the contract silently. Conversely, if the plugin opts into standard hook semantics, set -euo pipefail is the default. The contract drives the rules — not the other way around.
  2. 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.
  3. Stdin discipline. Tool-use and prompt-event hooks (PreToolUse, PostToolUse, UserPromptSubmit) receive JSON on stdin. SessionStart, SessionEnd, Stop, SubagentStop, Notification events 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.
  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 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.
  5. 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.
  6. Matcher specificity. "matcher": "*" on PreToolUse runs 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.
  7. Operational readability. When a hook fails at 3am, the on-call engineer needs to see what failed. Silent failures (errors redirected to /dev/null without 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.

Read the full file on GitHub · 275 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. 1mo ago First seen · 275 lines · 544 tokens per session scan B 8a14f6abce97

Subscribe to this mod's changes

hook-critic is an agent published in the GitHub repository fakoli/fakoli-plugins (4 stars, last pushed 27d ago), licensed MIT. It adds 544 tokens to every session and 4,361 once invoked, about $0.0022 per session on Opus 5.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.

Related

Other agents, from other repositories

dead-code-analyzer

Analyzes the codebase to find unused code — functions, imports, exports, variables, types, and classes — and produces a cleanup report with confidence levels. Never auto-deletes; reports findings for user review. Context: User wants to find unused code user: "find dead code" Context: User asks about code hygiene user…

lukaskellerstein/claude-my-marketplace · 160 tokens

screening-auditor

You are a skeptical, evidence-first auditor of recruiting deliverables: screening scorecards, evaluation rubrics, job descriptions, interview question sets, performance-review frameworks, and hiring-market claims. You operate in a strictly read-only capacity — you inspect artifacts and report findings; you never fix…

modu-ai/moai-cowork · 95 tokens

go-expert

Use this agent as a distinguished Go language authority and domain expert for peer-review-level code review. This agent NEVER writes implementation code — it reviews, critiques, and recommends with language-specific depth that generalist agents miss. Covers concurrency patterns, channel orchestration, interface…

asiflow/claude-nexus-hyper-agent-team · 456 tokens

gsd-ui-auditor

Retroactive 6-pillar visual audit of implemented frontend code. Produces scored UI-REVIEW.md. Spawned by /gsd:ui-review orchestrator.

travisjneuman/.claude · 41 tokens

shipkit-reviewer-shipping

Shipping judgment worker — verifies implementation quality across security, functionality, and code quality dimensions. Can dispatch QA sub-skills (ux-audit, semantic-qa, qa-visual). Writes structured verification report for the shipping orchestrator.

stefan-stepzero/shipkit · 53 tokens

agent-organizer

A highly advanced AI agent that functions as a master orchestrator for complex, multi-agent tasks. It analyzes project requirements, defines a team of specialized AI agents, and manages their collaborative workflow to achieve project goals. Use PROACTIVELY for comprehensive project analysis, strategic agent team…

qdhenry/Claude-Command-Suite · 66 tokens