Claude Code notification hooks: Stop and Notification explained
Updated 2026-12-04
Claude Code hooks are commands that Claude Code runs at fixed points in a session. Two of them are made for notifications: Stop and Notification. This page explains what each does and where hooks go wrong.
The events
| Event | Fires when | Use it to |
|---|---|---|
Stop | Claude finishes responding | Tell you a task is done |
Notification | Claude needs permission to use a tool, or has been idle waiting for your input | Tell you Claude is waiting |
UserPromptSubmit | You send a prompt | Record the start time, so you can skip short tasks |
Configuration
Hooks are configured in settings.json: ~/.claude/settings.json for all projects, .claude/settings.json for one project. Each event holds a list of hook groups, each with one or more commands:
{
"hooks": {
"Stop": [
{ "hooks": [ { "type": "command", "command": "node ~/notify.mjs" } ] }
]
}
}
What your command receives
Claude Code writes a JSON object to the command's standard input. It includes the event name (hook_event_name), the session_id and the working directory (cwd). For Notification there is also a message that says why Claude is notifying you. Read it with jq, Node or Python.
Pitfalls
- Hooks block. Claude Code waits for the command to finish. A popup that takes three seconds to appear delays every reply by three seconds. Start the slow part as a detached background process and return immediately.
- Short tasks spam you.
Stopfires on every response. Track the prompt start time withUserPromptSubmitand skip anything under about 15 seconds. - Settings load at session start. Restart the session after editing the file.
- Hooks that can hold Claude back are for decisions, not pings. A permission-request hook that waits for a popup stalls the session. Use
Notificationfor pings.
A ready-made version
InstantPing is a hook script plus a phone app. npx instantping setup installs Stop, Notification and UserPromptSubmit hooks, detaches the slow work, skips short tasks, and pushes to your phone. Remove it again with npx instantping uninstall.
Frequently asked questions
What is the difference between the Stop and Notification hooks?
Stop fires when Claude finishes a response. Notification fires when Claude needs permission to use a tool or has been idle waiting for your input.
Where do I configure Claude Code hooks?
In settings.json: ~/.claude/settings.json for all projects, or .claude/settings.json inside a project.
Why does my notification hook slow Claude Code down?
Claude Code waits for a hook command to finish. Start slow work, such as showing a popup, as a detached background process and return immediately.