claude-code-test-agent

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

A test agent for Claude Code hooks, which are actions that run when certain events occur during tool use. It records which of 30 configured hooks actually run.

In plain words
What is it for?
It is for checking hooks triggered by reading, web searches, writing files, shell commands, failures, and other configured Claude Code events.
Why use it?
It makes hook behavior observable instead of requiring someone to check each event manually. The test intentionally covers successful actions and a failed file read.

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-test-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-test-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/shanraisshan/claude-code-hooks/claude-code-test-agent.svg)](https://agentmods.dev/agents/shanraisshan/claude-code-hooks/claude-code-test-agent)
Your own site
<a href="https://agentmods.dev/agents/shanraisshan/claude-code-hooks/claude-code-test-agent"><img src="https://agentmods.dev/badge/agents/shanraisshan/claude-code-hooks/claude-code-test-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,112 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.00027 $0.03112
Opus 5 $0.00014 $0.01556
Sonnet 5 $0.00005 $0.00622
Haiku 4.5 $0.00003 $0.00311

Measured 4d ago against content hash 9496d33eebdd, 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-test-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 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.

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-test-agent.md · 304 lines

How it starts

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

You are the claude-code-test-agent. Your goal is to trigger as many of the 30 configured hooks as possible and report which ones actually fired. Follow ALL steps below in order.

CRITICAL: Clear the log first

Run: echo "--- Hook Test Started $(date) ---" > tests-agents-hook/agent-hook-fired.log

Step-by-Step Workflow

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

Read the file tests-agents-hook/agent-hook-fired.log to confirm the log was cleared.

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 test bash command executed at $(date)" >> tests-agents-hook/agent-hook-fired.log

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.

Step 7: Run final log check

Run: cat tests-agents-hook/agent-hook-fired.log and include the full log contents in your response.

All 30 Hooks Configured

  • PreToolUse — fires before every tool call
  • PostToolUse — fires after every successful tool call
  • PermissionRequest — fires when a tool needs user permission
  • PostToolUseFailure — fires after a failed tool call
  • PostToolBatch — fires after a batch of parallel tool calls resolves
  • UserPromptSubmit — fires when a user submits a prompt
  • UserPromptExpansion — fires when a slash command or MCP prompt expands into a prompt
  • Notification — fires when a system notification is sent
  • MessageDisplay — fires while an assistant message is displayed to the user
  • Stop — fires when the agent session ends
  • SubagentStart — fires when a subagent launches
  • SubagentStop — fires when a subagent completes
  • PreCompact — fires before context compaction
  • PostCompact — fires after context compaction completes
  • SessionStart — fires when a session begins
  • SessionEnd — fires when a session ends
  • Setup — fires during initial setup
  • TeammateIdle — fires when a teammate agent becomes idle
  • TaskCreated — fires when a task is being created via TaskCreate
  • TaskCompleted — fires when a subagent task completes
  • ConfigChange — fires when configuration changes
  • WorktreeCreate — fires when agent worktree isolation creates a worktree
  • WorktreeRemove — fires when agent worktree isolation removes a worktree
  • InstructionsLoaded — fires when CLAUDE.md or .claude/rules/*.md files are loaded into context
  • Elicitation — fires when an MCP server requests user input during a tool call
  • ElicitationResult — fires after a user responds to an MCP elicitation
  • StopFailure — fires when the turn ends due to an API error (rate limit, auth failure)
  • CwdChanged — fires when the working directory changes during a session
  • FileChanged — fires when files change during a session
  • PermissionDenied — fires after auto mode classifier denies a tool call

Read the full file on GitHub · 304 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 First seen · 304 lines · 27 tokens per session scan A 9496d33eebdd

Subscribe to this mod's changes

claude-code-test-agent is an agent published in the GitHub repository shanraisshan/claude-code-hooks (536 stars, last pushed 3mo ago), licensed MIT. It adds 27 tokens to every session and 3,112 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

langchain-specialist

Expert consultant for LangChain ecosystem development, LangSmith observability, LLM application architecture, and production deployment strategies. Use proactively for LangChain architecture analysis, chain composition strategies, LangSmith integration guidance, and production optimization recommendations. Provides…

spacehendrix/clauder · 119 tokens

api-architect

Expert consultant for REST/GraphQL API design, microservices architecture, and API governance. Use proactively for architectural analysis, API design reviews, service boundary recommendations, integration strategy planning, and API security assessments. This is a consultation-only specialist that provides detailed…

spacehendrix/clauder · 121 tokens

backend-testing-specialist

Expert consultant for testing strategies, test automation, and quality assurance for backend systems. Use proactively for analyzing testing requirements, designing test architectures, recommending QA frameworks, and providing comprehensive testing guidance for backend applications. Provides analysis and…

spacehendrix/clauder · 111 tokens

observability-engineer

Expert consultant for monitoring, logging, distributed tracing, and alerting for backend systems, providing analysis and recommendations without writing code. Use proactively for observability architecture design, monitoring strategy assessment, logging framework recommendations, tracing implementation guidance, and…

spacehendrix/clauder · 108 tokens

data-engineer

Expert consultant for data pipeline design, ETL/ELT processes, data architecture, and data quality, providing analysis and recommendations without writing code. Use proactively for data infrastructure consultation, pipeline architecture guidance, stream processing strategy, data storage optimization, and data…

spacehendrix/clauder · 110 tokens

data-scientist

Expert consultant for statistical analysis, ML model selection, hypothesis testing, and experimental design, providing analysis and recommendations without writing code. Use proactively for data science consultation, statistical methodology guidance, machine learning strategy planning, and experimental design…

spacehendrix/clauder · 104 tokens