eval-hooks

Audit Claude Code hooks in settings.json files for validity, timeouts, and exit-code correctness.

5.9k|769|Updated Jan 9, 2026
One-click install
npx skills add https://github.com/FlorianBruniaux/claude-code-ultimate-guide --skill eval-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eval-hooks
Source: https://github.com/FlorianBruniaux/claude-code-ultimate-guide/tree/main/examples/skills/eval-hooks
Command: npx skills add https://github.com/FlorianBruniaux/claude-code-ultimate-guide --skill eval-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Claude Code hooks often fail silently: scripts that are not executable, blocking hooks that use exit 1 instead of exit 2, missing timeouts that hang the agent, or matchers attached to events that ignore them. This Skill systematically audits every hook across all settings files and walks you through fixing each one interactively.

Core Features & Use Cases

  • Full hook discovery and scoring: Scans global and project settings.json files, parses every hook across all 30 event types, and scores each on a 10-point rubric covering event validity, matcher scope, command resolution, timeout, and blocking awareness.
  • Filesystem and semantics validation: Resolves each command against the filesystem, checks executability, verifies exit-code strategy in blocking hook scripts, and flags interactive commands that would hang the agent.
  • Interactive per-hook review: Walks through hooks one by one, confirms scope and usefulness with the user, applies fixes via Edit, and produces a final audit report with per-hook scores and a change summary.
  • Use Case: After copying hooks from another machine, run the audit to discover that a PreToolUse script lacks execute permissions and uses exit 1, then fix both issues in the same session.

Quick Start

Ask the assistant to audit all Claude Code hooks in your settings files and fix any that are broken, misconfigured, or missing timeouts.

Frequently Asked Questions about eval-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Claude Code hooks in settings.json?

Run the eval-hooks skill to scan all four standard settings files, parse every hook across all event types, and score each on a 10-point rubric. It then reviews hooks one by one interactively and applies fixes you approve.

Why is my PreToolUse hook not blocking the tool call?

Only exit code 2 blocks an action; exit 1 is a non-blocking error and the tool call proceeds. The audit reads your hook script, checks its exit-code strategy, and flags scripts that use exit 1 or have no explicit exit for blocking.

Why does my Claude Code hook never fire or fail silently?

The most common cause is a script that exists but lacks execute permission, which fails silently on most systems. Other causes include unknown event type names, matchers on events that do not support them, or an if field on a non-tool event.

What timeout should I set for Claude Code hooks?

Blocking interactive hooks like PreToolUse and UserPromptSubmit should have an explicit timeout of 30 seconds or less. Command hooks default to 600s, while SessionEnd hooks have only a 1.5s overall budget regardless of declared timeout.

Can async Claude Code hooks block a tool call?

No, async hooks cannot block; decision fields like block have no effect when async is true. The audit flags async hooks returning blocking decisions and suggests asyncRewake when a background process needs to signal failures back to Claude.