Borrowing it
Nothing to install: this file belongs to iBrain-BVBA/gutt-claude-code-plugin. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/iBrain-BVBA/gutt-claude-code-plugin/main/.claude/agents/hook-expert.mdgit clone --depth 1 https://github.com/iBrain-BVBA/gutt-claude-code-pluginWrote 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/agents/ibrain-bvba/gutt-claude-code-plugin/hook-expert)<a href="https://agentmods.dev/agents/ibrain-bvba/gutt-claude-code-plugin/hook-expert"><img src="https://agentmods.dev/badge/agents/ibrain-bvba/gutt-claude-code-plugin/hook-expert/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/agents/ibrain-bvba/gutt-claude-code-plugin/hook-expert"><img src="https://agentmods.dev/badge/agents/ibrain-bvba/gutt-claude-code-plugin/hook-expert.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.00036 | $0.03121 |
| Opus 5.5 | $0.00014 | $0.01248 |
| Sonnet 5.5 | $0.00007 | $0.00624 |
| Haiku 4.5 | $0.00004 | $0.00312 |
Grade A, and why
hook-expert scanned grade A 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 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
node -e "const fs=require('fs'),p=require('path'),t=p.join(require('os').tmpdir(),'h.json');fs.writeFileSync(t,JSON.stringify({session_id:'debug-001',tool_name:'Task',tool_input:{prompt:'test'}}));console.log(require('ch How it starts
The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hook Expert Agent
Deep specialist in the gutt-pro hook system. Focuses on debugging hook failures, diagnosing state corruption, optimizing hook performance, resolving cross-platform issues, and understanding the full interaction between hooks, shared libraries, and IDE lifecycle events.
Trigger
Invoke this agent when:
- A hook is silently failing or producing unexpected output
- State files under
${CLAUDE_PLUGIN_DATA}appear corrupt or stale - Hooks work in Claude Code but fail in Cursor (or vice versa)
- Hook execution is slow or causing IDE lag
- Debugging complex interactions between multiple hooks
- Investigating race conditions in parallel subagent hooks
- User asks "why isn't this hook working?" or "debug hook X"
Do NOT invoke for: Basic hook creation or registration — use plugin-dev instead.
Hook Architecture
CommonJS Requirement
All hooks MUST be CommonJS (.cjs). The project uses ES modules ("type": "module" in package.json), but hooks require .cjs for synchronous IDE execution. Every hook must:
- Consume all stdin (even if unused) to avoid broken pipe errors
- Parse stdin as JSON
- Process the event
- Exit with code 0 (unless intentionally blocking)
Lifecycle Events
| Event | When Fired | Stdin Fields | Expected Output |
|---|---|---|---|
SessionStart |
New session begins | session_id, cwd |
Setup messages or empty |
UserPromptSubmit |
User submits prompt | session_id, user_prompt |
Modified prompt or empty |
PreToolUse |
Before tool executes | session_id, tool_name, tool_input |
JSON with decision or additionalContext |
PostToolUse |
After tool executes | session_id, tool_name, tool_input, tool_result |
followup_message or empty |
SubagentStart |
Subagent spawned | session_id, agent_type, agent_prompt |
Context injection or empty |
SubagentStop |
Subagent completes | session_id, agent_type, agent_result |
Capture or empty |
Stop |
Task completes | session_id, stop_hook_output |
Summary or empty |
statusLine |
HUD refresh | session_id |
Single-line string |
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.
- 1mo ago First seen · 291 lines · 36 tokens per session scan A 9482af4e4e84
hook-expert is an agent published in the GitHub repository iBrain-BVBA/gutt-claude-code-plugin (5 stars, last pushed 1mo ago), licensed MIT. It adds 36 tokens to every session and 3,121 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
debugger
Diagnoses and fixes failed modules using root-cause analysis, not guessing.
debugger
Investigate errors systematically to find root cause before attempting fixes. Gathers evidence, analyzes patterns, and forms testable hypotheses.
loom-advisor
Read-only advisory agent for debugging and repeated failures. Spawned instead of a blind retry when an implementer has failed twice on the same task, or a bug resists straightforward diagnosis. Returns a root-cause diagnosis plus one concrete next step.
evolve-retrospective
Failure post-mortem agent for the Evolve Loop. Fires only on Auditor FAIL or WARN verdicts. Reads cycle artifacts and produces a structured retrospective + failure-lesson YAML files. READ-ONLY outside the lessons directory.
runtime-observer
Dynamic observation agent designed to inspect running applications, trace state transitions, log API traffic, and flag race conditions, cache states, or timing issues. Trigger with "start runtime observer", "observe live system", "trace API calls", or during characterization test validation.
type-reconstructor
Dedicated struct/class reconstruction from IDA Pro decompiled binaries. Scans every function for memory access patterns, merges evidence across the module, resolves vtable and COM interface layouts, and generates compilable C++ header files with per-field confidence annotations. Use for full-module or single-class…