Play a sound when Claude Code is done or needs you
Want a notification sound when Claude Code is done? Add afplay to two Claude Code hooks: one sound when Claude finishes, a different one when it needs your input. It works in any terminal on a Mac, costs nothing and takes two minutes.
Checked against Claude Code's documentation, and the commands tested on macOS, on 27 October 2026.
Fix 1: the terminal bell
The quickest sound is your terminal's bell. Add this to ~/.claude/settings.json:
{
"preferredNotifChannel": "terminal_bell"
}
It's one sound for everything, and only if your terminal's bell is on.
Fix 2: a sound per event with hooks
Claude Code runs a Notification hook when it waits for your input or a permission, Stop when it finishes responding, and StopFailure "when the turn ends due to an API error" (hooks guide). Give each its own macOS system sound:
{
"hooks": {
"Notification": [
{ "matcher": "", "hooks": [{ "type": "command", "command": "afplay -v 0.6 /System/Library/Sounds/Glass.aiff" }] }
],
"Stop": [
{ "hooks": [{ "type": "command", "command": "afplay -v 0.4 /System/Library/Sounds/Tink.aiff" }] }
],
"StopFailure": [
{ "hooks": [{ "type": "command", "command": "afplay -v 0.6 /System/Library/Sounds/Basso.aiff" }] }
]
}
}
-vsets the volume (1 is full). Try a command in Terminal first, for exampleafplay -v 0.6 /System/Library/Sounds/Glass.aiff.- The sounds in
/System/Library/Sounds: Basso, Blow, Bottle, Frog, Funk, Glass, Hero, Morse, Ping, Pop, Purr, Sosumi, Submarine, Tink. You can also pointafplayat your own file. Stopfires "whenever Claude finishes responding, not only at task completion" (hooks guide), so a short, quiet sound works best there.- To use different sounds for one project, put the hooks in that project's
.claude/settings.jsoninstead.
Where a plain sound falls short
- Music covers it. A short system sound at a polite volume is easy to miss under a song; turn it up and it startles you the rest of the time.
- Every session sounds the same. With several sessions open, you hear that one needs you, not which.
- It rings while you're looking. The sound plays even when you're typing in that very terminal, and after every short answer.
Bellpip handles these: a different chime for needs you, done and error; your music dips under each chime and comes back, so you hear it without losing the song (macOS 14.2 or later); in VS Code and Cursor terminals, no chime for questions in the one you're typing in; no done chime for tasks under 20 seconds; and the notch shows which session rang.
Bellpip is a little bell in your MacBook's notch for Claude Code: every session's state at a glance, its own chime when a session needs you, finishes or fails. macOS only. Free for 7 days of use, then pay what you want, even $0.
Questions
Why doesn't my hook play a sound?
Run the exact command in Terminal. If it's silent there, check the file path and your output volume. If it plays in Terminal but not from Claude Code, check that the JSON in ~/.claude/settings.json is valid and that the hook sits under "hooks".
Can I get a sound only for permission prompts?
Yes: set the Notification hook's "matcher" to "permission_prompt". It fires when a permission prompt has waited about six seconds (hooks guide).
Can I get a banner as well?
Yes, add a second command to the same hook. See Get notified when Claude Code needs your input.