Hooks check
Validate hooks configuration and scripts. Use after adding or editing hooks in settings.json, before committing hook changes, or when a hook fails to fire.From its SKILL.md
npx -y skills add claude-world/director-mode-lite --skill hooks-checkAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
3.3 KB, 845 tokens by cl100k_base, as published. Nobody here has run it
Hooks Validator
Validate hooks configuration in .claude/settings.json and hook scripts against
the official Claude Code spec.
Validation Steps
1. Check settings.json
Verify the hooks section exists and is valid.
2. Validate Hook Event Names
Claude Code defines 30 hook events. Accept any of them; flag unknown names
with a typo hint (e.g. PrePromptSubmit -> UserPromptSubmit,
PostToolBatchFailure -> PostToolBatch, SubagentStarts -> SubagentStart).
| Group | Events |
|---|---|
| Lifecycle | SessionStart, SessionEnd, Setup |
| Prompt | UserPromptSubmit, UserPromptExpansion |
| Tool | PreToolUse, PostToolUse, PostToolUseFailure, PostToolBatch |
| Permission | PermissionRequest, PermissionDenied |
| Subagent | SubagentStart, SubagentStop |
| Stop | Stop, StopFailure |
| Task | TaskCreated, TaskCompleted |
| Compaction | PreCompact, PostCompact |
| Notification | Notification, MessageDisplay |
| MCP elicitation | Elicitation, ElicitationResult |
| Environment | ConfigChange, CwdChanged, FileChanged, InstructionsLoaded, WorktreeCreate, WorktreeRemove, TeammateIdle |
That is all 30 events. See the official hooks docs for each event's payload.
3. Validate Each Hook Entry
-
typeis one of:command,prompt,http,mcp_tool,agent(defaultcommand) - If
type: command:commandpath exists and script is executable - If
type: prompt:promptstring is non-empty -
matcheris a string if present (tool events: tool name, regex, or*) -
timeoutis a positive integer if present (default: 60s per hook) -
onceis boolean if present -
if/statusMessageare strings if present
4. Validate Hook Scripts
- File exists and is executable
- Has an appropriate shebang
- If the script emits structured output on stdout, it is valid JSON.
Silent / exit-code-only hooks are valid — no stdout is required
(exit
0= allow/continue, exit2= block forPreToolUse).
Decision Output Schema
When a script does emit JSON, validate it against the event contract:
- PreToolUse:
hookSpecificOutput.permissionDecisionisallow,deny, orask. The legacy top-level{"decision": "approve" | "block"}is still accepted. - Stop / SubagentStop: continuation uses
{"decision": "block", "reason": "<next prompt>"}— the key isreason. - Input JSON always carries the event under
hook_event_name(nothook_type).
Output Format
## Hooks Validation Report
### Configuration Status: VALID / INVALID
### Configured Hooks
| Event | Matcher | Script | Status |
|-------|---------|--------|--------|
| Stop | * | auto-loop-stop.sh | OK |
### Script Validation
| Script | Exists | Executable | Output |
|--------|--------|------------|--------|
| auto-loop-stop.sh | OK | OK | JSON OK / silent |
### Issues Found
1. [Issue and fix]
Auto-Fix
- Make scripts executable
- Add missing shebang
- Create missing hook scripts
- Correct a misspelled event name to the nearest valid event
- Normalize
hook_type->hook_event_namein emitted JSON
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most quality gates skills give in 845 tokens
Counted across 1,524 of the 2,830 authors here whose files we hold, read 2026-09-06
- Read full output and check exit codein 45 of 1524, across 40 files
- Verify output confirms the claimin 44 of 1524, across 39 files
- Identify the command that proves the claimin 43 of 1524, across 39 files
- Execute the full verification commandin 36 of 1524, across 30 files
- Produce a verification reportin 34 of 1524, across 18 files
- Review git diff changesin 30 of 1524, across 16 files
- Fix build failures immediatelyin 29 of 1524, across 9 files
- Group findings by severityin 28 of 1524
- State claim only with evidencein 27 of 1524, across 22 files
- Verify regression tests with red-green cyclein 26 of 1524, across 22 files
- Run the full test suitein 26 of 1524, across 25 files
- Run test suite with coveragein 25 of 1524, across 10 files
Said here and by no other author read
- Validate hook event names against the official list
- Ensure prompt strings are non-empty
- Validate matcher types and timeout values
- Verify scripts have an appropriate shebang
- Validate structured output against the event contract
- Add missing shebangs to scripts
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.