Get a push notification when Claude Code finishes
You hand Claude Code a long task and walk away. Twenty minutes later it’s either done — or it’s been sitting there waiting for you to approve a command since minute two.
Claude Code has hooks for exactly these moments. Wire two of them to a push notification and your phone tells you which one happened.
The two moments that matter
Stopfires when Claude finishes responding — the task is done (or as done as it’s getting).Notificationfires when Claude needs you — typically waiting for permission to run something.
The second one is the sleeper. Nothing burns agent time like an approval prompt nobody saw.
Setup
You need a trigger.fyi key — grab one and export it as TRIGGER_FYI_SECRET_KEY. Then add hooks to ~/.claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "curl -s -m 3 -d \"Claude Code finished\" https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY"
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "curl -s -m 3 -d \"Claude Code needs your input\" https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY"
}
]
}
]
}
}That’s it. Kick off a task, put the phone in your pocket, go make coffee.
Include what actually happened
Hooks receive a JSON payload on stdin. A few lines of script make the notification say something useful — the project directory, for instance:
#!/bin/bash
# ~/.claude/hooks/notify-done.sh
input=$(cat)
dir=$(basename "$(echo "$input" | jq -r '.cwd // "unknown"')")
curl -s -m 3 -d "Claude Code done in $dir" "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY"Point the hook’s command at the script instead of the inline curl. Now a phone glance distinguishes “done in api-server” from “done in blog.”
Why push instead of a terminal bell
The terminal bell requires you to be at the terminal — which defeats the point of an agent that works while you don’t. A push notification follows you to the kitchen, the gym, the school run. And because trigger.fyi keeps a feed of everything sent, the notifications double as a log of what your agents did all day.
The same pattern works for any agent that can run a shell command or hit a URL — Cursor’s hooks, custom agent loops, CI-driven agents. If your agent runs long and unattended, it should be able to reach your pocket.
Related: AI agent notifications · Send from curl · Push notifications from bash · What is trigger.fyi