Skip to content

Instantly share code, notes, and snippets.

@stephanebruckert
Last active March 5, 2026 19:41
Show Gist options
  • Select an option

  • Save stephanebruckert/aba76eb855a283d38d31cf149f864091 to your computer and use it in GitHub Desktop.

Select an option

Save stephanebruckert/aba76eb855a283d38d31cf149f864091 to your computer and use it in GitHub Desktop.
Claude Code: Sound + Dock Bounce on Response

Claude Code: Sound + Dock Bounce on Response

Get an audible sound and dock icon bounce every time Claude finishes responding.

1. Add a Stop hook to ~/.claude/settings.json

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/stop-sound.sh",
            "timeout": 5000
          }
        ]
      }
    ]
  }
}

If you already have other hooks in your settings, just add the "Stop" entry alongside them.

2. Create the script ~/.claude/stop-sound.sh

#!/bin/bash
HOOK_INPUT=$(cat)
HOOK_EVENT=$(echo "$HOOK_INPUT" | grep -o '"hook_event_name":"[^"]*"' | cut -d'"' -f4)
if [ "$HOOK_EVENT" = "Stop" ]; then
    afplay /System/Library/Sounds/Glass.aiff &
    printf '\a' > /dev/tty 2>/dev/null
fi

3. Make it executable

chmod +x ~/.claude/stop-sound.sh

4. Enable dock bounce in your terminal

  • iTerm2: Preferences > Profiles > Terminal > check "Bounce Dock Icon"
  • Terminal.app: Preferences > Profiles > Advanced > check "Bounce dock icon"

Notes

  • afplay plays the sound (macOS only). Change the sound file path to use a different sound.
  • printf '\a' sends the terminal bell character, which triggers the dock bounce.
  • Available sounds are in /System/Library/Sounds/ (Glass, Ping, Pop, Tink, etc.).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment