claude-code-hook-agent

claude-code-hook-agent is an agent for Claude Code from shanraisshan/claude-code-hooks. It costs 22 tokens per session (955 once invoked), scanned A, original, MIT.

An agent that plays sounds when configured Claude Code session hooks run. Hooks are automatic actions triggered by events such as reading, writing, or running a command.

In plain words
What is it for?
Use it to test six agent-session hooks through file access, web searches, writing, shell commands, an intentional read failure, and a URL fetch.
Why use it?
It lets you verify that the session's supported hooks are firing by exercising each one.

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/shanraisshan/claude-code-hooks/claude-code-hook-agent
Clone the repo
git clone --depth 1 https://github.com/shanraisshan/claude-code-hooks

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 claude-code-hook-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/shanraisshan/claude-code-hooks/claude-code-hook-agent.svg)](https://agentmods.dev/agents/shanraisshan/claude-code-hooks/claude-code-hook-agent)
Your own site
<a href="https://agentmods.dev/agents/shanraisshan/claude-code-hooks/claude-code-hook-agent"><img src="https://agentmods.dev/badge/agents/shanraisshan/claude-code-hooks/claude-code-hook-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 955 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00022 $0.00955
Opus 5 $0.00011 $0.00477
Sonnet 5 $0.00004 $0.00191
Haiku 4.5 $0.00002 $0.00096

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

Security

Grade A, and why

claude-code-hook-agent scanned grade A with 0 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 3d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/claude-code-hook-agent.md · 102 lines

How it starts

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

You are the claude-code-hook-agent. Your goal is to trigger all 6 configured hooks (the only ones that actually fire in agent sessions) with sound playback. Follow ALL steps below in order.

Step-by-Step Workflow

Step 1: Read a file (triggers PreToolUse + PostToolUse)

Read the file .claude/agents/claude-code-hook-agent.md to confirm the hooks config.

Step 2: Web search (triggers PreToolUse + PostToolUse again)

Search the web for "current weather in Dubai UAE today" to get live weather data.

Step 3: Write a file (triggers PreToolUse + PostToolUse, may trigger PermissionRequest)

Write the weather results to tests-agents-hook/dubai-weather-report.txt.

Step 4: Run a bash command (triggers PreToolUse + PostToolUse, may trigger PermissionRequest)

Run: echo "Hook agent executed at $(date)"

Step 5: Intentionally read a non-existent file (triggers PostToolUseFailure)

Try to read tests-agents-hook/this-file-does-not-exist-12345.txt — this WILL fail and that is intentional to trigger the PostToolUseFailure hook.

Step 6: Fetch a URL (triggers PreToolUse + PostToolUse)

Fetch https://wttr.in/Dubai?format=3 to get a compact weather summary.

Hooks Configured (6 of 16 — only the ones that actually fire)

  • PreToolUse — fires before every tool call (plays agent_pretooluse sound)
  • PostToolUse — fires after every successful tool call (plays agent_posttooluse sound)
  • PermissionRequest — fires when a tool needs user permission (plays agent_permissionrequest sound)
  • PostToolUseFailure — fires after a failed tool call (plays agent_posttoolusefailure sound)
  • Stop — fires when the agent session ends (plays agent_stop sound)
  • SubagentStop — fires when a subagent completes (plays agent_subagentstop sound)

Output Format

After completing all steps, provide:

  1. Weather Report:
    • Location: Dubai, UAE
    • Temperature: [Celsius and Fahrenheit]
    • Conditions: [description]
    • Humidity: [percentage]
    • Wind: [speed and direction]

Read the full file on GitHub · 102 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. 3d ago First seen · 102 lines · 22 tokens per session scan A c6d3e8b9fb7f

Subscribe to this mod's changes

claude-code-hook-agent is an agent published in the GitHub repository shanraisshan/claude-code-hooks (531 stars, last pushed 3mo ago), licensed MIT. It adds 22 tokens to every session and 955 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. 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

requirement-parser

Analyzes feature request descriptions and extracts structured requirements, goals, constraints, and metadata for downstream planning agents.

shanraisshan/claude-code-best-practice · 25 tokens

development-workflows-research-agent

Research agent that fetches GitHub repos, counts agents/skills/commands, gets star counts, and analyzes Claude Code workflow repositories.

shanraisshan/claude-code-best-practice · 33 tokens

weather-agent

Use this agent PROACTIVELY when you need to fetch weather data for Dubai, UAE. This agent fetches real-time temperature by invoking the weather-fetcher skill via the Skill tool.

shanraisshan/claude-code-best-practice · 41 tokens

time-agent-pkt

Use this agent to display the current time in Pakistan Standard Time (PKT, UTC+5). (root scope — see agent-teams for Dubai time).

shanraisshan/claude-code-best-practice · 37 tokens

presentation-claude-gemini

PROACTIVELY use this agent whenever the user wants to update, modify, rearrange, or fix the CLAUDE-GEMINI presentation (presentation/2026-04-25-gdg-kolachi-cli-claude-code-gemini/index.html) — slides, structure, styling, journey bar levels, or day/level organization. Do NOT use this agent for the vibe-coding…

shanraisshan/claude-code-best-practice · 101 tokens

presentation-claude-code

PROACTIVELY use this agent whenever the user wants to update, modify, rearrange, or fix the CLAUDE-CODE-BEST-PRACTICE presentation (presentation/claude-code-best-practice/index.html) — slides, structure, styling, level transitions, or content reuse from other decks. This is the canonical reusable Claude Code…

shanraisshan/claude-code-best-practice · 125 tokens