Skip to content
Development
Skill

/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 plugin
director-mode-lite
8036 skills14 agents6 hooks

Claude Code

$ npx -y skills add claude-world/director-mode-lite --skill hooks-check --agent claude-code

SKILL.md

hooks-check.SKILL.md
name: hooks-check
description: 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.
user-invocable: true

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 **33 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` | | Model | `PreModelSwitch`, `PostModelSwitch` | | Environment | `ConfigChange`, `CwdChanged`, `DirectoryAdded`, `FileChanged`, `InstructionsLoaded`, `WorktreeCreate`, `WorktreeRemove`, `TeammateIdle` |

That is all 33 events. See the official hooks docs for each event's payload.

3. Validate Each Hook Entry

  • [ ] `type` is present and one of: `command`, `prompt`, `http`, `mcp_tool`, `agent`
  • [ ] If `type: command`: `command` path exists and script is executable; a

shell-form path variable is quoted (`"$CLAUDE_PROJECT_DIR"/...`), or the hook uses exec form (`args`)

  • [ ] If `type: prompt` or `agent`: `prompt` string is non-empty
  • [ ] If `type: http`: `url` is set; if `type: mcp_tool`: `server` and `tool` are set
  • [ ] `matcher` is a string if present (exact names joined by `|` or `,`, `*`,

or a regex); warn when it sits on an event without matcher support (`UserPromptSubmit`, `Stop`, `PostToolBatch`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, `MessageDisplay`, `CwdChanged`), where it is silently ignored

  • [ ] `timeout` is a positive integer if present (defaults: 600s command/http/mcp_tool, 30s prompt, 60s agent)
  • [ ] `if` is a permission rule such as `Bash(git *)`, used only on tool events
  • [ ] `onFailure` is `continue` or `block` (v2.1.295+); recommend `block` for security guards
  • [ ] `once` appears only in skill frontmatter hooks; settings files ignore it
  • [ ] `async` / `asyncRewake` appear only on command hooks
  • [ ] `statusMessage` is a string if present
  • [ ] `SessionEnd` matchers do not use `bypass_permissions_disabled` (removed in v2.1.234)

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, exit `2` = block for `PreToolUse`).

---

Decision Output Schema

When a script does emit JSON, validate it against the event contract:

  • **PreToolUse**: `hookSpecificOutput.permissionDecision` is `allow`, `deny`,

`ask`, or `defer` (`-p` only). The legacy top-level `{"decision": "approve" | "block"}` is still accepted.

  • **Prompt / agent hooks**: the model's verdict is `{"ok": true}` or

`{"ok": false, "reason": "..."}`.

  • **Stop / SubagentStop**: continuation uses

`{"decision": "block", "reason": "<next prompt>"}` — the key is `reason`.

  • Input JSON always carries the event under `hook_event_name` (not `hook_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_name` in emitted JSON
Read more
@claude-world
Ships withdirector-mode-lite

Use Claude Code like a Director, not a Programmer. MIT toolkit with Auto-Loop, guided setup, 27 commands, 14 agents, and 32 skills.

8036 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
80
Star history of claude-world/director-mode-lite on GitHub, a chart by star-history.com

Other skills on director-mode-lite.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about hooks-check.

Which coding agents can use hooks-check?
hooks-check installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.