Hear Claude Code notifications over your music
You put music on, start a long Claude Code task, and miss the moment it needs you: a short alert at a polite volume disappears under a song. Turning the alert up only means it startles you when the music stops. Three ways to hear Claude over music on a Mac, from free to automatic.
Tested on macOS with Claude Code 2.1.311 and Apple Music on 27 October 2026.
Why the alert gets lost
Claude Code's sound, or a hook's afplay, plays on top of whatever is already playing. A chime of a fraction of a second competes with a full song at the same volume, and a sound in the same range as the music is the hardest to pick out. The two volumes also aren't linked: a sound loud enough to cut through the music is too loud in a quiet room.
Fix 1: a louder, sharper sound (free)
Give the hook a sound that stands out from music, and play it at full volume. A short, high, bright sound such as Glass or Ping cuts through better than a low one:
{
"hooks": {
"Notification": [
{ "matcher": "", "hooks": [{ "type": "command", "command": "afplay -v 1 /System/Library/Sounds/Glass.aiff" }] }
]
}
}
-v 1 is full volume. If you use "preferredNotifChannel": "terminal_bell" instead, the bell plays at the alert volume in System Settings → Sound → Alert volume, which is separate from your music volume. The catch: loud enough for music is loud in silence. More hook options: Play a sound when Claude Code is done or needs you.
Fix 2: pause the music when Claude needs you (free)
A hook can pause Apple Music when Claude needs you and play it again when you answer. Save this as ~/.claude/hooks/music.sh and make it executable with chmod +x ~/.claude/hooks/music.sh:
#!/bin/sh
# pause Apple Music while Claude Code needs you; play it again when you answer
mark="${TMPDIR:-/tmp}/claude-paused-music"
case "$1" in
pause)
state=$(osascript -e 'if application "Music" is running then tell application "Music" to return player state as text')
if [ "$state" = playing ]; then
osascript -e 'tell application "Music" to pause' && touch "$mark"
fi ;;
resume)
if [ -f "$mark" ]; then
rm -f "$mark"
osascript -e 'tell application "Music" to play'
fi ;;
esac
Then add the hooks to ~/.claude/settings.json:
{
"hooks": {
"Notification": [
{ "matcher": "", "hooks": [
{ "type": "command", "command": "~/.claude/hooks/music.sh pause; afplay /System/Library/Sounds/Glass.aiff" }
] }
],
"UserPromptSubmit": [
{ "hooks": [{ "type": "command", "command": "~/.claude/hooks/music.sh resume" }] }
],
"PostToolUse": [
{ "hooks": [{ "type": "command", "command": "~/.claude/hooks/music.sh resume" }] }
]
}
}
- It only plays the music again if the hook paused it, so music you stopped yourself stays stopped. It leaves Music alone when it isn't running.
UserPromptSubmitresumes when you type your next prompt;PostToolUseresumes after you approve a permission and the tool runs.- To also pause when Claude finishes, add
music.sh pauseto aStophook.Stopruns after every answer, so the music will stop often. - Spotify: replace
"Music"with"Spotify"in the threeosascriptlines. Spotify's AppleScript has the same commands, but we tested only Apple Music. Don't use the Spotify version without Spotify installed:osascriptcan't compile a script for an app it can't find. - Music in a browser tab (YouTube, a web player) can't be paused this way.
In our test, a Stop hook running music.sh pause paused a playing Apple Music track the moment Claude finished, and music.sh resume played it again.
Fix 3: lower the music under the chime (Bellpip)
Pausing works, but your music stops every time a session wants you. Bellpip does what radio presenters do: while its chime plays, it lowers the music (to 15% by default, adjustable), then brings it back up. You hear the chime clearly and the music keeps going. It works with whatever is playing: Spotify, Apple Music, a browser tab, a video.
- Each state has its own chime: "needs you", "done" and "error" sound different, so you know which without looking.
- The notch shows which session it was, and one click takes you there.
- Lowering the music is off until you turn it on (in the welcome window or Settings → Ducking), and needs macOS 14.2 or later, which lets an app adjust other apps' sound. macOS asks your permission the first time.
Bellpip keeps every Claude Code session in your MacBook's notch and rings with its own chime when one needs you, finishes or fails, with your music lowered under the chime. macOS only. Free for 7 days of use, then pay what you want, even $0.
Questions
Why can't I hear Claude Code's notification while music plays?
The alert is short and plays at the same time as the song, so the music masks it. Use a brighter sound at full volume, pause the music from a hook, or lower the music under the alert.
Can a Claude Code hook pause Spotify?
Yes, with osascript: the script above with "Spotify" instead of "Music". Resume it from a UserPromptSubmit hook.
Does Bellpip pause my music?
No. It lowers it for the length of the chime and brings it back, so the music never stops.