Claude, ping me

I run a lot of Claude Code sessions at once, usually across a few repos, and I kept missing the moment one of them stopped. Either it was done and waiting for me to review, or it was stuck on a question and I had no idea for a while.

So I set up notifications with Claude Code hooks. There are three of them:

  • Stop fires when Claude finishes a turn.
  • Notification fires when Claude is blocked on me — a permission prompt, a question, or sitting idle waiting for input.
  • SubagentStop fires when a subagent finishes. I keep this one off unless I'm running parallel work, because a big fan-out will spam you.

They're wired up in ~/.claude/settings.json:

"Notification": [
  { "hooks": [{ "type": "command", "command": "$HOME/.claude/hooks/notification.sh" }] }
],
"Stop": [
  { "hooks": [{ "type": "command", "command": "$HOME/.claude/hooks/notify-on-stop.sh" }] }
],
"SubagentStop": [
  { "hooks": [{ "type": "command", "command": "$HOME/.claude/hooks/subagent-stop.sh" }] }
]

This is the Notification one, asking for permission to run a command:

claude-needs-you-toast

The part I like most is that the toast tells me what kind of attention Claude needs:

  • ❓ It asked me a question → the notification shows the question
  • 📋 It has a plan waiting for approval
  • 🙋 Anything else that's blocked on me, like the permission prompt above
  • ✅ It actually finished → the notification shows the last line of its reply

That way I can tell from the toast whether I need to drop what I'm doing or if it can wait.

I had this wrong at first. I thought a question would end Claude's turn, so I had the Stop hook look for it. It doesn't — Claude keeps the turn open and waits, and the question shows up as a Notification asking for permission to use the AskUserQuestion tool. The Notification event doesn't say which tool, but the message text does, so the script matches on that and pulls the question out of the session transcript.

claude-question-toast

A plan waiting for approval works the same way:

claude-plan-toast

Here's the ✅ one, from the session that drafted this post:

claude-finished-toast

Every notification has the project folder name in the title, so with a bunch of sessions going I know which one is pinging me.

All of the hooks call one shared helper that picks the right way to notify for the OS:

  • macOS: terminal-notifier (or osascript if it's not installed)
  • Linux: notify-send
  • Windows: the BurntToast PowerShell module, called from Git Bash

The same helper also sends every notification to my phone through ntfy. It makes a call with curl to post the message to my ntfy topic, and the ntfy app on my phone picks it up. Anyone who knows the topic name can read or send to it, so the name lives in a local env file and not in the repo.

ntfy-phone-pushes

One more thing I had to add: a CLAUDE_NOTIFY=0 switch to mute everything. When I script a batch of claude -p runs, I don't want a pile of "finished" toasts.

What you need

Drafted with an assistant, edited by @wintaru

0 comments