DEV Community

Varun D
Varun D

Posted on

[Claude Code] Sound Notification on Completion

Tested on MacOS.

Add notification when Claude Code is done. Enabled through global settings. You can configure more hooks to run commands.

Add settings.json if it doesn't exist

On Linux/MacOS: ~/.claude/settings.json
On Windows: %USERPROFILE%\.claude\settings.json

settings.json file content

Add the "hooks" section to your settings.json file if you already have other stuff in there like Status Line, etc.

For MacOs, below "command" runs a sound using the inbuilt sound player afplay.

For Windows use powershell -c (New-Object Media.SoundPlayer 'C:\\Windows\\Media\\chimes.wav').PlaySync().

{
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "afplay ~/.claude/sounds/success.mp3 &"
          }
        ]
      }
    ]
  },
}
Enter fullscreen mode Exit fullscreen mode

Default system sounds on MacOS

Here are the built-in macOS system sounds, all located in /System/Library/Sounds/

/System/Library/Sounds/Glass.aiff
/System/Library/Sounds/Ping.aiff
/System/Library/Sounds/Submarine.aiff
/System/Library/Sounds/Funk.aiff
/System/Library/Sounds/Hero.aiff
/System/Library/Sounds/Basso.aiff
/System/Library/Sounds/Blow.aiff
/System/Library/Sounds/Bottle.aiff
/System/Library/Sounds/Frog.aiff
/System/Library/Sounds/Morse.aiff
/System/Library/Sounds/Pop.aiff
/System/Library/Sounds/Purr.aiff
/System/Library/Sounds/Sosumi.aiff
/System/Library/Sounds/Tink.aiff
Enter fullscreen mode Exit fullscreen mode

You can preview any of them in your terminal with:
afplay /System/Library/Sounds/Glass.aiff

Default system sounds on Windows

Built-in Windows sounds you can use (no install needed):

C:\Windows\Media\chimes.wav
C:\Windows\Media\ding.wav
C:\Windows\Media\notify.wav
C:\Windows\Media\chord.wav

Top comments (0)