# Why is my Claude Code hook not firing?

Canonical: https://cwyn.com/pages/claude-code-guide-hooks-not-firing.html
Last updated: 2026-11-26T21:35:43-05:00

Claude Code setup guide

Open `/hooks` in the affected Claude Code session. If a shared hook is missing, check `.claude/settings.json` for invalid JSON. If your formatter is listed under `PostToolUse`, use `Edit|Write` to match both tools. Ask Claude to edit a scratch file and inspect the formatting. A successful hook can run silently.

By CWYN · Last updated November 26, 2026 · Not affiliated with Anthropic · [Hook events and matchers](https://code.claude.com/docs/en/hooks-guide) (as of Nov 18, 2026) · Published November 18, 2026

## 1. Find the hook under its event

Need a working example first? [Copy a notification, formatting or protected-file hook](https://cwyn.com/pages/claude-code-guide-hooks-examples.html) and try its test in a scratch project.

Run `/hooks` in the affected session. For a shared project hook, check `.claude/settings.json` if the entry is missing. Check the JSON for comments or a trailing comma. If a saved correction still does not appear, restart the session and reopen the menu. A managed-only notice means your organization restricts which hooks can run.

## 2. Match the event to the actual edit

A formatter that should run after a successful edit belongs under `PostToolUse`. Match the tool Claude used. A matcher of `Edit` is case-sensitive and misses a file created with `Write`. If the formatter should handle both tools, use the documented matcher `Edit|Write`.

## 3. Give the formatter an observable change

Choose a scratch file your formatter handles. Ask Claude to edit an existing line so the formatter has something to correct. Confirm the matching tool ran, then inspect the file. If it now follows the formatter’s rules, the hook can be working even when the conversation shows no success message. To repeat the test from the original line, see [how to undo Claude’s edit with `/rewind`](https://cwyn.com/pages/claude-code-guide-rewind-checkpoints.html).

## 4. Inspect a failed command

If the expected change is absent, press Ctrl+O in the terminal session to inspect the transcript for a hook error. A command-not-found message points to the handler path. Use an absolute path to the script or anchor it to `${CLAUDE_PROJECT_DIR}`. Retry the same scratch edit and compare the file and transcript.

Record the formatter command and the paths it handles in your [project CLAUDE.md](https://cwyn.com/pages/claude-code-guide-claude-md-template.html) so teammates can run the same check.

If your project also uses OpenClaw and its Gateway reports `ENOTEMPTY` during startup, follow the [NFS snapshot cleanup guide](https://cwyn.com/pages/openclaw-guide-nfs-snapshot-cleanup.html) for that error.

Sources · [Hook events, matchers and troubleshooting](https://code.claude.com/docs/en/hooks-guide) · Nov 18, 2026 · Checked against docs, not run.

## Related guides

- [Why does Claude Code still ask after I allow a command?](https://cwyn.com/pages/claude-code-guide-permission-allowlist-prompts.html)
- [Claude Code ignoring CLAUDE.md or not loading it?](https://cwyn.com/pages/claude-code-guide-claude-md-not-loading.html)
- [Why is my MCP server missing from Claude Code?](https://cwyn.com/pages/claude-code-guide-mcp-servers-not-loading.html)
- [CLAUDE.md vs AGENTS.md: which file each tool reads](https://cwyn.com/pages/claude-code-guide-claude-md-vs-agents-md.html)

## Next steps

- [All 34 Claude Code guides](https://cwyn.com/guides/claude-code/)
- [Claude Code setup walkthrough](https://cwyn.com/setup/claude-code/)
- [Check your CLAUDE.md](https://cwyn.com/score/setup-file-checker/?profile=claude)
- [Claude Code Complete Setup Pack ($12.95)](https://cwyn.com/pages/pack-claude-code-complete-setup-pack.html)

### Set up your Claude Code project

Compare your hook settings with the `SessionStart` examples for new and resumed sessions in the [Claude Code Complete Setup Pack ($12.95)](https://cwyn.com/pages/pack-claude-code-complete-setup-pack.html).
Kit details as of Nov 22, 2026

Claude Code Complete Setup Pack $12.95

Set up project instructions, permission rules, hooks, a reviewer skill and subagent, and MCP connections for Claude Code.
