File of the day
A Claude Code hook that shows the start of every reply in a notification
Slava Sazhin 15 October 2026 3 min read 0 views
When Claude Code finishes a reply, a notification with its first words pops up in the corner of the screen, so you can work in another window.
Today's file is a Claude Code hook for people who give Claude a task and go to another window. Then you either keep coming back to check whether it has finished, or you come back half an hour later and find it stopped in the first minute with a question for you. With this hook every finished reply shows up as a notification in the corner of the screen with the start of the reply, so you can tell "Done, all tests pass" from "Should I delete the old folder?" without leaving the window you are in.
How it works
It is a Stop hook: Claude Code runs it each time a reply ends and passes it the text of the reply. The hook removes the Markdown marks *, ` and #, joins the lines into one, keeps the first 120 characters and shows them in a macOS notification with the title "Claude Code" and the subtitle "Reply ready". An empty reply shows "Work finished". The reply reaches the notification as plain text, never as part of a command, so a reply that quotes code or a web page cannot run anything: we fed the hook 21 sample replies with quotes, $( ), backticks and AppleScript commands in them, and each one arrived as text. The hook never stops Claude, the notification is all it does.
What we changed
One line. A reply that starts with a dash, a bulleted list for example, was handed to the notification command as if it were one of its options. On Linux, where the note has Claude swap osascript for notify-send, such a reply showed no notification at all, only an "Unknown option" error that nobody sees. The hook now drops dashes and spaces at the start of the text, so "- Fixed the bug" shows as "Fixed the bug", and dashes inside the text stay. The same trim covers osascript on a Mac and the command of any other system.
What to know
- The hook runs after every reply, in
claude -pruns too: a job you start on a schedule also ends with a notification. - The notification shows the start of the reply as it is. If Claude puts a password or a customer's name in its first line, it appears in the corner of the screen and stays in Notification Center.
- Not on a Mac: step 6 of the note has Claude swap in your system's notification command. In our tests Claude wrote
notify-sendon Linux (4 times of 4) and a PowerShell notification on Windows (2 of 2), each time passing the reply as text.
Install
One file goes into ~/.claude/hooks/ and is connected in ~/.claude/settings.json as a Stop hook. That folder holds Claude's own settings, so Claude asks before it writes there: answer Yes. The note below then has Claude check that jq is installed and send one test notification, and you allow notifications for Script Editor in System Settings, Notifications: on a Mac, notifications from scripts arrive under that name. Then close Claude Code and open it again, because hooks are read at startup. The check: ask "Reply in one line: notifications work" and switch to another window right away. A few seconds later a "Claude Code" notification with the start of the reply appears in the corner of the screen.
The files
Files of the day are for paying subscribers: any plan opens every one. Already subscribed? Then sign in.
See the plansWas this article worth your time?
Read next
File of the day
A Claude Code command that brings three to five signals about your competitors every week
Type /competitors once a week and Claude Code brings three to five dated signals about what your competitors did and why it matters to your business.
File of the day
A Claude Code rule that tells you in a minute whether to take an order
Paste an order, a tender or an offer, and Claude Code answers bid now, not now or pass, with one reason and five scores.
File of the day
A Claude Code rule that shows where a page breaks before your customers see it
Claude Code fills every preview with your longest real names and biggest numbers, so you see a broken card before your customers do.
Give Claude a computer of its own
Your own Linux machine with Claude Code on it, working around the clock while your laptop is shut. From $3.49 a month.