1-minute implementation
It really does take 1 minute. Copy this entire post into Claude Code and tell it to set this up for you. It’ll configure the hook, and your part is two steps:
- Download ntfy on your iPhone
- Paste the topic ID that Claude Code generates into the ntfy app
After that you’ll get a notification on your iPhone (and Apple Watch) whenever Claude Code finishes. You don’t need to restart anything. The hook is already active by the time Claude Code finishes setting it up, so that response itself triggers your first notification.
5-minute implementation
I often kick off a long task in Claude Code and go grab a coffee or stretch or start on something else. And then I’d come back way too early with it still running, or way too late when it had finished ages ago.
So I set up push notifications that hit my iPhone the moment Claude Code finishes responding. It works anywhere my phone is online, whether that’s on a walk or in another country. And if you’ve got an Apple Watch, the notification mirrors to your wrist as a haptic tap, which is honestly pretty satisfying.
If you’d rather set it up by hand, this is how.
How it works
Claude Code has hooks. A hook is a shell command that runs when a lifecycle event happens, and the Stop hook fires every time Claude finishes its turn. So we use that hook to send a push notification through ntfy, a free and open-source notification service.
Claude Code finishes → Stop hook fires → curl hits ntfy.sh → iPhone notification → Apple Watch vibrates
What you need
- Claude Code, installed and working
- An iPhone with the ntfy app (free on the App Store)
- An Apple Watch paired to your iPhone (optional, for the wrist tap)
Step 1: Set up ntfy on your iPhone
- Install ntfy from the App Store
- Open the app and tap + to subscribe to a new topic
- Pick a secret topic name. This is your private channel, so use something hard to guess, like a UUID. Anyone who knows the name can send you notifications, so treat it like a password.
# Generate a random topic name
uuidgen | tr '[:upper:]' '[:lower:]'
# Example output: 86e59607-fe76-4619-9b48-8d4892d79868
- Subscribe to that topic in the ntfy app
Step 2: Add the Stop hook to Claude Code
Open your Claude Code user settings file at ~/.claude/settings.json and add a hooks section. If there’s already stuff in the file, merge this in:
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "curl -s -d 'Claude Code done' ntfy.sh/YOUR_TOPIC_NAME > /dev/null 2>&1 &"
}
]
}
]
}
}
Replace YOUR_TOPIC_NAME with the topic you subscribed to in Step 1.
The trailing & runs curl in the background so Claude Code isn’t stuck waiting on it, and > /dev/null 2>&1 throws away the output.
Bonus: Add a local sound too
Want a chime on your Mac as well when Claude finishes? Put both in one hook:
"command": "afplay /System/Library/Sounds/Glass.aiff & curl -s -d 'Claude Code done' ntfy.sh/YOUR_TOPIC_NAME > /dev/null 2>&1 &"
There are a bunch of built-in macOS sounds in /System/Library/Sounds/. If Glass isn’t your thing, try Ping.aiff, Pop.aiff, Purr.aiff or Hero.aiff.
Step 3 (optional): Turn on Apple Watch mirroring
Most Apple Watches have notification mirroring on by default, so this should already work. If you’re not seeing anything on your watch, check these settings:
- Open the Watch app on your iPhone
- Go to Notifications
- Find ntfy in the app list
- Turn on Mirror iPhone Alerts
Also, your watch only shows mirrored notifications when your iPhone’s locked. Otherwise the notification stays on the phone.
Step 4 (optional): Activate the hook
Did you edit settings.json while Claude Code was already running? Then you may need to restart Claude Code, or run /hooks in your current session, so it picks up the new hook. If you went with the 1-minute implementation above and copied this post into Claude Code, the hook is already active and you don’t need to restart.
Step 5 (optional): Test it
If you did the 1-minute implementation, you’ve already had your first notification, since Claude Code’s response triggered the hook. Otherwise, send a test one from your terminal:
curl -s -d 'Claude Code done' ntfy.sh/YOUR_TOPIC_NAME
It should show up on your phone straight away. To test the watch, lock your iPhone first and run the same curl command again. You should feel a tap on your wrist.
Bonus: A slash command to toggle notifications
Once this is set up you’ll want a way to turn push notifications on and off. Your watch doesn’t need to buzz for every quick question, only for the long-running stuff.
So make a custom Claude Code slash command that toggles them with a single /push-notifications.
Create a file at ~/.claude/skills/push-notifications/SKILL.md:
---
name: push-notifications
description: Toggle ntfy.sh push notifications on or off in the Stop hook
disable-model-invocation: true
---
Toggle push notifications in `~/.claude/settings.json` Stop hook.
Steps:
1. Read `~/.claude/settings.json`
2. Find the Stop hook command
3. If the command contains the ntfy.sh curl, remove it (disable push notifications). The sound-only command should be: `afplay /System/Library/Sounds/Glass.aiff`
4. If the command does NOT contain the ntfy.sh curl, add it back (enable push notifications). The full command should be: `afplay /System/Library/Sounds/Glass.aiff & curl -s -d 'Claude Code done' ntfy.sh/YOUR_TOPIC_NAME > /dev/null 2>&1 &`
5. Edit the settings file to apply the change
6. Tell the user the new state (enabled or disabled)
Replace YOUR_TOPIC_NAME with your own ntfy topic. Now you can type /push-notifications in any Claude Code session to flip them on or off. It takes effect immediately and you don’t need to restart.
Tips
- Privacy. Your topic name is the only auth you’ve got, so pick something random and don’t share it publicly. If you want token-based auth, ntfy also supports access control.
- Custom messages. You can put more context in the notification body. This one adds the working directory:
"command": "curl -s -d \"Done in $(basename $PWD)\" ntfy.sh/YOUR_TOPIC_NAME > /dev/null 2>&1 &" - Linux. For the local sound, replace
afplaywithpaplay /usr/share/sounds/freedesktop/stereo/complete.oga. - Notification priority. ntfy has priority levels. Add
-H "Priority: high"to the curl command if you want a more aggressive notification that bypasses Do Not Disturb. - Other hook events. Claude Code also has
PreToolUse,PostToolUse,NotificationandSubagentStophooks, so you could get notified about specific events, like a subagent finishing a background task.
Why not use macOS notifications?
They work great when you’re at your desk, but they can’t reach you once you’re away from your computer. ntfy goes over the internet. Your Mac sends a request to ntfy’s server, that pushes it to your phone, and your phone mirrors it to your watch. Your watch’s eSIM or Wi-Fi connection handles the rest, so you could be on a different continent and still get the tap.