AI EngineerGuide

How to use Claude Code hooks to play sound when tasks finish

by Ashik Nesin Ashik Nesin

Claude Code has hooks feature using which you can trigger a shell command before certain action is performed like SessionStart, UserPromptSubmit, Notification, Stop, etc.

What you can do is that you can use afplay (or similar command depending on your OS) to play sound instead.

Here is how Delba has configured her Claude Code. It’s pretty interesting and funny at the same time.

You can also configure something similar for your claude code by adding the needed hooks .claude/settings.json

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff"
          }
        ]
      }
    ]
  }
}

You can go crazy with the sounds like Mario or Spongebob which you can get it from here: https://www.myinstants.com/en/search/

Reference

Stay Updated

Get the latest AI engineering insights delivered to your inbox.

No spam. Unsubscribe at any time.