Claude Code macOS system notifications

· Christopher Hoelter's Blog


When multi-tasking with Claude, system notifications help you know when it needs input or has finished.

This guide is for macOS with Ghostty and tmux, but can be adapted to other setups.

1. Install terminal-notifier #

brew install terminal-notifier

2. Create the notification script #

Save this to ~/.local/bin/claude-notify:

#!/bin/bash

# Capture tmux context for the pane where Claude is running (not the current view)
SESSION=$(tmux display-message -t "$TMUX_PANE" -p '#{session_name}')
WINDOW=$(tmux display-message -t "$TMUX_PANE" -p '#{window_index}')
WINDOW_NAME=$(tmux display-message -t "$TMUX_PANE" -p '#{window_name}')
SOCKET=$(echo "$TMUX" | cut -d',' -f1)
CLIENT=$(tmux display-message -p '#{client_tty}')

terminal-notifier \
  -title "Claude Code" \
  -subtitle "$SESSION:$WINDOW_NAME" \
  -message "${1:-Waiting for input}" \
  -sound default \
  -activate com.mitchellh.ghostty \
  -execute "/opt/homebrew/bin/tmux -S $SOCKET switch-client -c '$CLIENT' -t '$SESSION:$WINDOW'"

3. Configure Claude's hooks #

Add this to ~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "~/.local/bin/claude-notify"
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "~/.local/bin/claude-notify"
          }
        ]
      }
    ]
  }
}
last updated:

Email me at blog@christopherhoelter.com.