Feature: Sound notifications
Windsurf has a feature you can enable to have it play a ding sound when it's done thinking and it's the user's turn. This is great, especially if it's easy to turn on and off, and even more so now that Opus allows for very long turns (I'm currently 1091 seconds into a run right now), so I know when to turn my attention back to it.
the same for VScode. terminal in vscode not playing a sound when Claude Code done with something despite me turning alert sounds on. it works in regular (non-vscode terminal though).
For me it does not work either in vscode or in native MacOS terminal. Tried both "auto", "terminal_bell" and even claude config set --global preferredNotifChannel "\a" claude config set --global preferredNotifChannel "afplay /System/Library/Sounds/Ping.aiff"
yeah and plz also support email / text notification if possible
Could we add an option to execute a user-defined script when a task completes or needs confirmation? This would let developers create personalized notifications (e.g., email, SMS).
Currently, relying solely on terminal alerts presents challenges. They can be cumbersome to configure, sometimes don't work reliably, and can also be disruptive. For instance, if a user customizes the alert sound to be louder, it might trigger frequently for minor errors (like typos), causing unnecessary noise.
Script execution would offer greater flexibility, bypassing these limitations and giving users better control over their notification preferences.
I'd like to second @arrrggghhh's proposal here, running a bash command or similar would be much more flexible.
Second this, the bell feature isn't working for me on Kubuntu 24's native terminal, when e.g. printf '\a' makes a bell sound just fine.
I got it working in MacOS and vscode. vscode: "accessibility.signals.terminalBell": { "sound": "on" "terminal.integrated.enableVisualBell": true
Claude Code config set to terminal_bell
I managed to get it working using @SKALO-SE's method. Thank you so much! However, I can't forget the exciting notification sound from RooCode. I'd be really happy if more fun sounds could be implemented in the future.
Older similar issue: https://github.com/anthropics/claude-code/issues/104
terminal_bell setting does not ever cause a notification to be emitted even though running echo -e "\a" from bash mode within claude code in same context works fine.
Running echo -e "\a" in WSL2 on Windows works. After launching claude in the same window it does not anymore. Is a fix planned?
Would love to be able to customize the sound, any idea on how to do that?
Does anyone here know if we can use this notification channel to call an mcp tool? Ideally, I'd like to setup such that when a task is complete, a slack message is sent, via mcp.
If they introduced the "run arbitrary commad" concept, you could do this. As it stands, no.
@PastaPastaPasta you can do it instructing Claude in CLAUDE.md to perform a command ALWAYS after it finishes however this will burn some ammount of tokens.
This would really improve my workflow if possible to fix!
- On WezTerm,
[email protected] - Manual
echo -e "\a"triggers a bell sound - Setting
claude config set --global preferredNotifChannel terminal_belldoesn't trigger on Claude complete- (FWIW, setting the terminal_bell option in the
/configUI doesn't fix it either)
- (FWIW, setting the terminal_bell option in the
Sounds like this ticket can be closed because you can handle it with hooks, no? https://docs.anthropic.com/en/docs/claude-code/hooks#notification-2
I think there should still be a feature here and they can use hooks under the hood? Plus none of the included options work (or only flakily in specific circumstances). If they want to rip out this feature entirely, then fine, close the issue, but that work hasn't been done.
+1 towards solving this with hooks. Currently experimenting with:
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Glass.aiff"
}
]
}
],
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Submarine.aiff"
}
]
}
]
Here is how I got it working.
First step: deciding on a notification command
First, you need to know the command you want to run in order to receive a notification.
It could be a cURL request to ntfy.sh, or a command that shows a notification on your laptop.
For my use case, I decided to show a notification on my laptop.
Here is my command:
notify-send --app-name="Claude Code" --icon /home/clouedoc/Pictures/claude.png --urgency normal "Claude Code" "Needs your attention"
Do note that notify-send is specific to Linux (as far as I know).
I downloaded an icon of Claude to illustrate my notification :-)
Second step: setting up the hooks
- Open Claude code
- Type
/hooks - Add a hook on the "Stop" hook, set the command that you picked (or copy mine above). Same with the "Notification" hook. Save them as user configuration
- Done!
Here is how it looks on my system (with Mako as a notification daemon):
Just created similar workaround to @clouedoc with https://github.com/julienXX/terminal-notifier
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -group 'PROJECT_NAME' -title 'Claude Code Stopped' -subtitle \"Event: $CLAUDE_EVENT_TYPE\" -message \"Last tool: ${CLAUDE_TOOL_NAME:-N/A} | Files: $(echo \"$CLAUDE_FILE_PATHS\" | wc -w | tr -d ' ')\" -sound Glass"
}
]
}
]
Appears on mac like this:
Thanks for the hint with terminal-notifier, @clouedoc!
I use this for managing the hook via nix + home-manager:
".claude/settings.json".text = builtins.toJSON {
hooks = {
Stop = [
{
matcher = ".*";
hooks = [
{
type = "command";
command = ''${pkgs.terminal-notifier}/bin/terminal-notifier -title "Claude Code" -message "Task completed""'';
}
];
}
];
};
};
the bell notification is working for me using WSL devcontainers. You need to adjust the vscode settings, add the claude notification bell setting, and then you need to NOT be focused on the claude code window when it completes.
vscode settings:
"terminal.integrated.enableVisualBell": true,
"accessibility.signals.terminalBell": {
"sound": "on",
"announcement": "auto",
},
Edit: at the same time I did the above, I also added a Stop hook .py script that (attempts) to output the user's latest prompts. So if just changing the above settings doesn't work, maybe also add a hook.
Thank you for the suggestion! You can either use preferredNotifChannel (https://docs.anthropic.com/en/docs/claude-code/settings) or hooks (https://docs.anthropic.com/en/docs/claude-code/hooks) to set up sound notifications
guys, which hook is for the decision box that asks user to choose whether to accept edit or reject? the accessibility sound terminal bell is delayed about 3 seconds after the box appears, which is not ideal. I tried pretooluse and notification hooks, but they are not working,
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.