Alien Desk

Guides

How to get a notification when Claude Code finishes

Start a long task, switch to something else, and know the moment Claude Code is done: with a Stop hook that plays a sound or shows a macOS notification, or with a small Mac panel.

Claude Code tasks often take several minutes. You switch to another window, and when you come back it finished long ago, or it has been waiting for you the whole time.

Option 1: play a sound with a Stop hook

Claude Code runs the Stop hook each time Claude finishes responding. Add this to ~/.claude/settings.json to hear a short sound:

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

afplay comes with macOS, and /System/Library/Sounds/ has more sounds to choose from.

Option 2: show a notification

Use osascript instead to show a macOS notification:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude Code is done\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}

The notification is shown on behalf of Script Editor, so the first time macOS may ask you to allow it. If nothing appears, check System Settings → Notifications.

Both hooks tell you that some session finished. With several tabs open you still have to find which one, and a sound you missed is gone.

Option 3: see what finished, and where

Alien Desk keeps one row per Claude Code tab in a small panel. A finished tab keeps a green dot until you look at it, a tab that needs your permission moves to the top, and one click brings that Terminal, iTerm2 or Ghostty tab to the front. It can play a short sound when a tab finishes, too. This part is free.

More guides