Claude Code notification hook not working: how to fix it
Updated 2026-12-04
If your Claude Code notification hook does nothing, the cause is almost always one of a handful of things. Work through this list from the top. Most problems are found in the first three steps.
1. Is the hook registered?
Type /hooks in Claude Code to see the hooks it loaded. If yours is missing, the settings file is not being read: check the path (~/.claude/settings.json for user settings, .claude/settings.json inside a project) and that the JSON is valid. A trailing comma or a missing bracket silently breaks the whole file. Restart the session after every edit.
2. Does the command work on its own?
Copy the exact command from the settings file and run it in a terminal. If it fails there, it will fail as a hook. Fix it first.
3. Quoting and paths
- The command is a string inside JSON, so double quotes inside it must be escaped as
\". - On Windows, use forward slashes (
C:/Users/you/script.ps1) or escaped backslashes. - Use absolute paths. The hook may not run from the folder you expect.
- Do not rely on shell aliases or functions. Hooks do not load your interactive shell setup.
4. Exit codes
A hook that exits with code 2 is treated as a blocking error, which can stop Claude from finishing. Some tools return 2 for usage errors. End your command with ; exit 0 if you are unsure.
5. Where does the notification have to appear?
- Over SSH: a hook runs on the remote machine, so a desktop popup appears there, not on your laptop. Push to your phone instead (ntfy, Telegram, a phone app).
- In WSL:
notify-senddoes not reach the Windows desktop. Callpowershell.exefrom WSL instead. - On Windows: toasts under the generic PowerShell name can be dropped. See the Windows guide.
- On macOS: check System Settings, Notifications, for the app that shows the popup, and Focus modes.
6. Is the hook firing but you hear nothing?
Make the command write to a file, for example date >> /tmp/hook.log, and check that the file grows. If it does, the hook works and the problem is the notification channel (Do Not Disturb, volume, permissions).
7. Short tasks
If you filter short tasks and nothing arrives, the task may simply have been under your threshold. InstantPing ignores tasks under 15 seconds by default, which is the most common reason for "it did not ping" in a quick test.
Still stuck?
Start from a known-good example: Get a notification when Claude Code is done, then read how the hooks work.
Frequently asked questions
Why is my Claude Code hook not running?
Usually the settings JSON is invalid or not loaded. Run /hooks to see what Claude Code registered, fix the JSON, and restart the session.
Why does my Claude Code notification not appear over SSH?
A hook runs on the machine where Claude Code runs, so a desktop popup shows up there. Send a phone push instead of a desktop notification.
Can a hook stop Claude Code from finishing?
Yes. A hook that exits with code 2 is treated as a blocking error. Make sure your notification command exits with 0.