hooks-expert

hooks-expert is an agent for Claude Code from claude-world/director-mode-lite. It costs 129 tokens per session (2,852 once invoked), scanned A, original, MIT.

An expert guide to Claude Code hooks, which are automated handlers triggered by events in coding sessions.

In plain words
What is it for?
It explains and designs hooks for events such as tool use, prompts, session changes, and notifications, with guidance for setup and troubleshooting.
Why use it?
It helps developers choose the right event and design the input, validation, automation, or security behavior around tool calls and sessions.

Agent for Claude Code

Written for Claude Code: $CLAUDE_PROJECT_DIR variable. Also seen: model in frontmatter; reads .claude/ paths; mentions subagents.

Part of the director-mode-lite plugin — 36 skills, 14 agents shipped together

Good fit It explains and designs hooks for events such as tool use, prompts, session changes, and notifications, with guidance for setup and troubleshooting.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/claude-world/director-mode-lite/hooks-expert
Install

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.

Clone the repo
git clone --depth 1 https://github.com/claude-world/director-mode-lite

Made for: Claude Code.

Or install director-mode-lite, the plugin that ships this one along with the rest of its 36 skills, 14 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 hooks-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/claude-world/director-mode-lite/hooks-expert/github.svg)](https://agentmods.dev/agents/claude-world/director-mode-lite/hooks-expert)
Your own site
<a href="https://agentmods.dev/agents/claude-world/director-mode-lite/hooks-expert"><img src="https://agentmods.dev/badge/agents/claude-world/director-mode-lite/hooks-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.

agentmods 80×15 button for hooks-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/claude-world/director-mode-lite/hooks-expert"><img src="https://agentmods.dev/badge/agents/claude-world/director-mode-lite/hooks-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 129 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,852 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00129 $0.02852
Opus 5.5 $0.00052 $0.01141
Sonnet 5.5 $0.00026 $0.00570
Haiku 4.5 $0.00013 $0.00285

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

Security

Grade A, and why

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

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST "$SLACK_WEBHOOK_URL" \
agents/hooks-expert.md · 381 lines

How it starts

The opening of the file, as written. The whole thing — 381 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hooks Expert

You are an expert on Claude Code hooks - the automation system that triggers actions based on events. You help users create powerful automated workflows.

Activation

Automatically activate when:

  • User mentions "hook", "automation", "trigger"
  • During hook setup or project initialization (/project-init)
  • User wants automatic actions on certain events
  • User asks about Stop hooks, PreToolUse, PostToolUse, UserPromptSubmit

Keeping Current

Before answering spec questions about hook events or the JSON I/O schema, verify against the official docs — fetch https://code.claude.com/docs/en/hooks with WebFetch when it is available, since events and fields change between releases. The inline reference below was last verified against Claude Code v2.1.305 (2026-10-21); treat the live docs as authoritative if they differ.

Core Knowledge

Inline reference last verified against Claude Code v2.1.305 (2026-10-21). Confirm against the official hooks docs if in doubt (see Keeping Current above).

What are Hooks?

Hooks are handlers that run in response to Claude Code events. They enable automation, validation, and workflow customization.

Hook Events

The most commonly used events:

Event When it Runs Use Case
PreToolUse Before a tool executes Validate, block, or auto-approve
PostToolUse After a tool executes Log, lint, run tests, react
UserPromptSubmit When the user submits a prompt Inject context, validate, or block
Stop When the main agent tries to stop Continue autonomous loops
SubagentStop When a subagent (Agent/Task) finishes Chain or gate subagent results
Notification On Claude Code notifications External integrations, alerts
SessionStart When a session starts/resumes Load context, set up state
SessionEnd When a session ends Persist state, cleanup
PreCompact Before context compaction Save or summarize state

These are the events you will use most often. Claude Code defines 33 hook events in total — see the official hooks reference for the complete list. Note: the event is UserPromptSubmit (there is no PrePromptSubmit).

Read the full file on GitHub · 381 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 Changed · +9 lines c5ae36841893
  2. 3mo ago Changed 5dfad9926684
  3. 3mo ago First seen · 372 lines · 129 tokens per session scan A de49da9f7486

Subscribe to this mod's changes

hooks-expert is an agent published in the GitHub repository claude-world/director-mode-lite (81 stars, last pushed 1mo ago), licensed MIT. It adds 129 tokens to every session and 2,852 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

hooks-expert compared with agents from other repositories

hooks-expert next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
hooks-expertclaude-world/director-mode-liteAgent811mo agoMITA129Claude Code
fizzy-taskskeskinonur/claude-plugin-fizzyAgent310mo agoApache-2.0A39Claude Code
webapi-integrationmicrosoft/power-platform-skillsAgent1.2ktodayMITA182Claude Code
blind-authorqwerfunch/claddingAgent162mo agoMITA75Claude Code
code-explorersequenzia/agent-alchemyAgent466mo agoMITA27Claude Code
wiki-dev-eng-uxodere-pro/claude-wiki-pages-pluginAgent35mo agoMITA181Claude Code
playwright-test-generatormicrosoft/playwrightAgent102ktodayApache-2.0A151Claude Code