Get notified when Claude Code finishes a task

I’ve been using Claude Code lately, and I found myself wanting a simple way to know when Claude finished a task. Instead of watching the terminal, I figured a quick notification sound would do the trick. Luckily, Claude supports hooks, which are customizable actions that run when certain events occur. By editing the settings.local.json file in your project after init’ing, you can make Claude play a macOS system sound whenever a task completes.

Here’s the hook configuration I added to my file:

{
  "permissions": {
    "allow": ["Bash(bin/rails runner:*)"],
    "deny": []
  },
  "hooks": {
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Tink.aiff"
          }
        ]
      }
    ]
  }
}

This runs the afplay command to play the classic “Glass” sound that macOS ships with. It works every time Claude finishes running, giving me instant audible feedback that a process has ended. It also plays a different sound when Claude needs your attention. It’s a small tweak, but it makes the workflow feel more complete and less like I’m waiting around for something to silently finish. Hope you enjoy this tip!