validate-hook

validate-hook is a command for Claude Code from athola/claude-night-market. It costs 13 tokens per session (1,346 once invoked), scanned A, original, MIT.

A command for checking Claude Code and SDK hooks, which are scripts that run at specific points in an agent's work. It scans them for security, performance, and SDK compliance issues.

In plain words
What is it for?
Use it to validate one hook, selected checks, or every hook in a directory, and to produce a report or apply possible fixes.
Why use it?
It helps catch vulnerabilities, slow behavior, timeout problems, and rule violations before a hook is deployed or committed.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the abstract plugin — 16 skills, 17 commands, 5 agents, 4 hooks shipped together

Good fit Use it to validate one hook, selected checks, or every hook in a directory, and to produce a report or apply possible fixes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/athola/claude-night-market/validate-hook
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/athola/claude-night-market

Made for: Claude Code.

Or install abstract, the plugin that ships this one along with the rest of its 16 skills, 17 commands, 5 agents, 4 hooks.

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 validate-hook

README.md
[![agentmods](https://agentmods.dev/badge/commands/athola/claude-night-market/validate-hook/github.svg)](https://agentmods.dev/commands/athola/claude-night-market/validate-hook)
Your own site
<a href="https://agentmods.dev/commands/athola/claude-night-market/validate-hook"><img src="https://agentmods.dev/badge/commands/athola/claude-night-market/validate-hook/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 validate-hook

Your own site · 80×15
<a href="https://agentmods.dev/commands/athola/claude-night-market/validate-hook"><img src="https://agentmods.dev/badge/commands/athola/claude-night-market/validate-hook.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,346 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.00013 $0.01346
Opus 5 $0.00006 $0.00673
Sonnet 5 $0.00003 $0.00269
Haiku 4.5 $0.00001 $0.00135

Measured 9d ago against content hash a266ea9798f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

validate-hook 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 9d 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.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **Privilege Escalation**: Permission checks, sandboxing, sudo usage, chmod operations

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

plugins/abstract/commands/validate-hook.md · 192 lines

How it starts

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

Validate Hook Command

Detailed validation for Claude Code and SDK hooks. Performs security scanning, performance analysis, and compliance verification.

When To Use

Use this command when you need to:

  • Developing hooks and need validation before deployment
  • Auditing existing hooks for security vulnerabilities
  • Checking hook performance and timeout compliance
  • Verifying compliance with SDK best practices
  • Before committing hook changes

When NOT To Use

Avoid this command if:

  • Creating new hooks - use /create-hook instead
  • Evaluating all hooks in plugin - use /hooks-eval instead
  • Deciding hook placement - use hook-scope-guide skill

Usage

# Validate all aspects (default)
/validate-hook hooks/my-hook.py

# Validate specific aspects
/validate-hook hooks/my-hook.py --security
/validate-hook hooks/my-hook.py --performance
/validate-hook hooks/my-hook.py --compliance

# Validate all hooks in directory
/validate-hook hooks/ --all

# Generate detailed report
/validate-hook hooks/my-hook.py --report

# Auto-fix issues where possible
/validate-hook hooks/my-hook.py --fix

Validation Categories

Security Scan (--security)

Checks for security vulnerabilities and unsafe patterns:

  • Input Validation: Type checking, size bounds, sanitization
  • Command Injection: Shell command safety, parameter escaping, code injection patterns
  • Path Traversal: Path validation, directory restrictions, directory traversal attacks
  • Data Leakage: PII handling, credential exposure, hardcoded secrets
  • Privilege Escalation: Permission checks, sandboxing, sudo usage, chmod operations
  • Crypto Issues: Weak encryption, insecure randomness

Score: PASS (100%), WARN (80-99%), FAIL (<80%)

Performance Check (--performance)

Analyzes hook efficiency and resource usage:

  • Timeout Compliance: Execution within limits (1-10s typical)
  • Resource Usage: Memory, CPU, file handles
  • Blocking Operations: Async patterns, non-blocking I/O
  • Caching: Result caching, expensive operation optimization
  • Early Exits: Fast-path optimization
  • Scalability: Performance under load, large file handling
  • Pattern Matching Efficiency: Regex compilation, loop optimization

Read the full file on GitHub · 192 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. 9d ago First seen · 192 lines · 13 tokens per session scan A a266ea9798f2

Subscribe to this mod's changes

validate-hook is a command published in the GitHub repository athola/claude-night-market (336 stars, last pushed 3d ago), licensed MIT. It adds 13 tokens to every session and 1,346 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.