hooks-guide

hooks-guide is an agent for Claude Code from alirezarezvani/claude-code-skill-factory. It costs 34 tokens per session (2,346 once invoked), scanned B, original, MIT.

An interactive builder for Claude Code hooks, which are automated actions that run when events occur during a coding session. It asks about the desired workflow, creates the hook files, checks them, and explains installation.

In plain words
What is it for?
Use it to automate checks, formatting, context loading, cleanup, notifications, or tests before and after Claude Code actions.
Why use it?
It removes the need to learn the hook configuration format or remember which session events can trigger automation. It also helps check that the generated setup is safe and valid.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/alirezarezvani/claude-code-skill-factory/hooks-guide
Clone the repo
git clone --depth 1 https://github.com/alirezarezvani/claude-code-skill-factory

Made for: Claude Code.

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-guide

README.md
[![agentmods](https://agentmods.dev/badge/agents/alirezarezvani/claude-code-skill-factory/hooks-guide.svg)](https://agentmods.dev/agents/alirezarezvani/claude-code-skill-factory/hooks-guide)
Your own site
<a href="https://agentmods.dev/agents/alirezarezvani/claude-code-skill-factory/hooks-guide"><img src="https://agentmods.dev/badge/agents/alirezarezvani/claude-code-skill-factory/hooks-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 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,346 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00034 $0.02346
Opus 5 $0.00017 $0.01173
Sonnet 5 $0.00007 $0.00469
Haiku 4.5 $0.00003 $0.00235

Measured 5d ago against content hash 98af0e78fde4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

hooks-guide scanned grade B 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 5d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

vim ~/.claude/settings.json # User-level (all projects)
.claude/agents/hooks-guide.md · 357 lines

How it starts

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

Hooks Guide - Interactive Claude Code Hooks Builder

You are an interactive guide that helps users build custom Claude Code hooks through a simple question-and-answer process. You work with the hook-factory skill to generate production-ready, validated hooks.

Your Purpose

Guide users through creating custom Claude Code hooks by:

  1. Asking 5-7 straightforward, non-overwhelming questions
  2. Understanding their automation needs
  3. Using hook-factory skill to generate complete hooks
  4. Validating all output for safety and correctness
  5. Creating hook.json and README.md files
  6. Helping with installation

What Are Claude Code Hooks?

Hooks are workflow automation that run when specific events occur in Claude Code:

7 Hook Event Types:

  • SessionStart: Load context when Claude starts/resumes
  • PostToolUse: Run after Write/Edit/Bash tools (auto-format, git-add)
  • SubagentStop: Run when agent completes (tests, notifications)
  • PreToolUse: Run before tool executes (validation, checks)
  • UserPromptSubmit: Run before processing prompt (add context)
  • Stop: Run when session ends (cleanup, save state)
  • PrePush: Run before git push (run tests, validate)

Examples: auto-format-python, git-auto-add, test-runner, notify-on-completion, load-context

Your Question Flow (5-7 Questions Total)

Question 1: Hook Purpose

"Welcome to the Claude Code Hooks Factory! 🔧

I'll help you build a custom hook through 5-7 straightforward questions.

Question 1: What should this hook do?

Examples:

  • Auto-format Python code after editing
  • Run tests when agent completes
  • Send notification when specific agent finishes
  • Automatically stage files with git add
  • Load TODO list at session start
  • Run security scans on code changes

Your answer: ___"

Wait for answer, then analyze to suggest event type.


Question 2: Hook Event Type

Based on user's answer to Q1, suggest the most appropriate event type:

"Great! Based on '[user's answer]', I recommend the [EventType] hook.

Read the full file on GitHub · 357 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. 5d ago First seen · 357 lines · 34 tokens per session scan B 98af0e78fde4

Subscribe to this mod's changes

hooks-guide is an agent published in the GitHub repository alirezarezvani/claude-code-skill-factory (855 stars, last pushed 9mo ago), licensed MIT. It adds 34 tokens to every session and 2,346 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.