hooks-expert

hooks-expert is an agent for Claude Code from claude-world/director-mode-lite. It costs 129 tokens per session (2,573 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: PreToolUse hook event. 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.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.svg" alt="Measured on agentmods" 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,573 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.02573
Opus 5 $0.00064 $0.01287
Sonnet 5 $0.00026 $0.00515
Haiku 4.5 $0.00013 $0.00257

Measured 4d ago against content hash 5dfad9926684, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 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.

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 · 372 lines

How it starts

The opening of the file, as written. The whole thing — 372 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.201 (2026-07-06); treat the live docs as authoritative if they differ.

Core Knowledge

Inline reference last verified against Claude Code v2.1.201 (2026-07-06). 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 30 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 · 372 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 5dfad9926684
  2. 8d 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 7d ago), licensed MIT. It adds 129 tokens to every session and 2,573 once invoked, about $0.0006 per session on Opus 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

Other agents, from other repositories

fizzy-tasks

Lightweight agent for Fizzy.do task management without cluttering your main conversation context. Use for listing boards, creating cards, syncing todos, or closing completed work.

keskinonur/claude-plugin-fizzy · 39 tokens

reviewer

Philosophical guardrails enforcer — independently audits code, tests, and spec for layered-integrity, Why>What, error-as-data, and the related Ironclad philosophical invariants. Activate only when the connected project contains spec.yaml or the user explicitly names Cladding; ignore ordinary requests in uninitialized…

qwerfunch/cladding · 68 tokens

plan-creation-eng-lead

Engineering and Delivery Lead for implementation planning. Produces work breakdown structures, effort estimates, dependency graphs, milestones, parallel opportunities, and risk registers. Use when you need structured delivery planning for any implementation topic.

QBall-Inc/the-bulwark · 48 tokens

perf-theory-tester

Execute controlled perf experiments, one change at a time, with rollback between runs.

composio-community/awesome-claude-plugins · 22 tokens

task-executor

Executes a single Claude Code Task through a 4-phase workflow with adaptive verification. Use this agent to execute a specific task by understanding requirements, implementing code changes, verifying against acceptance criteria, and reporting completion.

sequenzia/agent-alchemy · 46 tokens

wiki-dev-pm

Product Manager for the claude-wiki-pages development team. Owns the eleven product goals, per-item acceptance criteria, scope and prioritization, and the seven open questions that need user sign-off (NO-RAG reframe, multi-vault writes, durable memory, and the rest). Use when an item needs a product decision, an…

odere-pro/claude-wiki-pages-plugin · 118 tokens