CLAUDE CODE

How to get Claude Code notifications on your Mac

Get notified on macOS when Claude Code finishes or needs input, with built-in alerts, the terminal bell, Notification and Stop hooks and terminal-notifier.

Short answer

On macOS, Claude Code already sends a desktop notification in Ghostty, Kitty and iTerm2 (after you enable iTerm2 alerts), and you can force a terminal bell with preferredNotifChannel set to terminal_bell. For full control, add a Notification hook (fires when Claude waits for permission or input) and a Stop hook (fires when Claude finishes a reply) that run osascript, afplay or terminal-notifier.

To get Claude Code notifications on a Mac, you have three layers to work with: the notifications Claude Code sends by itself in some terminals, the terminal bell setting, and hooks that run any command you like when Claude needs you or finishes. Most people end up with a mix: the built-in notification for permission prompts, plus a Stop hook for "done".

This guide walks through each option, with the exact settings and commands, and the macOS quirks that make notifications silently fail.

Does Claude Code send notifications on macOS by default?

Claude Code sends a notification event when it finishes a task or pauses for a permission prompt and you appear to be away from the terminal. What you actually see depends on your terminal, according to the official terminal configuration docs:

TerminalDefault behavior
Ghostty, KittyDesktop notification, when Claude Code detects the terminal
iTerm2Desktop notification, after you turn on iTerm2's alert settings
Apple TerminalNo sound. A silent bell character if "Audible bell" is off in the profile, otherwise nothing
Other terminals (Warp, VS Code terminal, others)Nothing

For iTerm2, open Settings, then Profiles, then Terminal. Check "Notification Center Alerts", click "Filter Alerts" and enable "Send escape sequence-generated alerts". If notifications still do not appear, make sure the terminal app itself has notification permission in System Settings.

How do I make Claude Code ring the terminal bell?

Set preferredNotifChannel to "terminal_bell" in ~/.claude/settings.json. Claude Code then sends the bell character whatever the terminal or profile:

{
  "preferredNotifChannel": "terminal_bell"
}

In Apple Terminal, also turn on "Audible bell" under Settings, then Profiles, then Advanced, or you will not hear it. Note that running /terminal-setup in Apple Terminal turns the profile's audible bell off, so check this setting again afterwards. The default value, "auto", is what you want if you rely on Ghostty, Kitty or iTerm2 desktop notifications. For the other keys in that file, see the settings.json guide.

How do I get a notification when Claude Code needs input?

Add a Notification hook. Claude Code fires the Notification event when Claude is waiting for permission or input, and hooks run alongside the built-in notification rather than replacing it. This is the example from the official hooks guide, for ~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}

The empty matcher fires on every notification type. To narrow it, use a type as the matcher. The two that matter most:

MatcherFires when
permission_promptClaude needs you to approve a tool use, and the prompt has waited about six seconds
idle_promptClaude finished responding about 60 seconds ago and you have not typed since

Other types exist (authentication, MCP elicitation, background agents, usage limit auto resume), listed in the Claude Code hooks guide. The hook also receives the notification's message and notification_type as JSON on stdin, so a script can show the real text instead of a fixed string.

Why does osascript show no notification?

osascript posts notifications through the built-in Script Editor app. If Script Editor has no notification permission, the command fails silently and macOS does not ask. Run this once in Terminal:

osascript -e 'display notification "test"'

Then open System Settings, Notifications, find Script Editor, and turn on Allow Notifications. Run the command again to confirm.

How do I get a notification when Claude Code finishes?

Use a Stop hook. In Claude Code, Stop fires whenever Claude finishes responding, which is the moment a task is done and the agent waits for your next prompt. It does not fire when you interrupt Claude, and API errors fire StopFailure instead.

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Task finished\" with title \"Claude Code\" sound name \"Glass\"'"
          }
        ]
      }
    ]
  }
}

Stop has no matcher support, so leave the matcher out. Two things to know: it fires after every reply, including short answers, and it is different from idle_prompt, which waits about a minute. If you only want long tasks, a small script can compare timestamps or read last_assistant_message from the input before deciding to notify.

How do I play a sound instead?

Use afplay with one of the system sounds. The official terminal docs give this Notification hook:

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

Different sounds for "needs input" and "done" make it easy to tell them apart without looking.

How do I use terminal-notifier with Claude Code?

terminal-notifier is an open source command line tool that posts macOS notifications, with options osascript lacks, such as grouping and opening a specific app when you click. Install it with Homebrew:

brew install terminal-notifier

Then use it in a hook. This script reads the message from the hook input and brings iTerm2 to the front on click:

#!/bin/bash
MSG=$(jq -r '.message // "Claude Code needs your attention"')
terminal-notifier -title "Claude Code" -message "$MSG" \
  -sound default -group claude-code -activate com.googlecode.iterm2

-group replaces the previous notification in the same group, so you do not get a stack of them. Replace the bundle ID with your terminal's (for Apple Terminal, com.apple.Terminal). Save the script, chmod +x it, and point a Notification hook's command at it.

Do notifications work inside tmux?

Not by default. Inside tmux, desktop notifications do not reach the outer terminal. Add these lines to ~/.tmux.conf, run tmux source-file ~/.tmux.conf, and restart Claude Code:

set -g allow-passthrough on
set -g focus-events on

Hooks that call osascript or terminal-notifier are not affected, because they post the notification directly from macOS. That makes hooks the more reliable choice if you run several Claude Code sessions in tmux panes.

A calmer way to do this

Hook notifications tell you that something happened, but you still have to find the right terminal tab and answer there. Allowbar, a Mac menu bar app for Claude Code and Codex, connects through the same hooks (it adds its entries to ~/.claude/settings.json and leaves your own hooks alone) and handles both halves.

When a session needs permission, a Dynamic Island style panel slides down with the project, the tool and the exact command, and you answer with Allow, Block, or Terminal. When a task finishes, you get a done notification, so you can watch a video or play while agents work. A session list shows which ones are working, waiting for you or done, and clicking one opens its terminal tab. Allowbar never approves anything on its own, runs only on macOS 14 or later, and supports Claude Code and Codex. The comparison with plain hooks is in Allowbar vs terminal notifications.

Allowbar is in private beta. Join the waitlist; the launch price is $9.99 instead of $29.90.

Sources:

Frequently asked questions

Why do I get no Claude Code notification in Apple Terminal?

Apple Terminal does not receive Claude Code's desktop notification. Set preferredNotifChannel to "terminal_bell" and enable "Audible bell" in the profile, or add a Notification hook that runs osascript or afplay.

Which hook tells me Claude Code is done?

The Stop hook. It fires each time Claude finishes responding. The Notification hook with idle_prompt also covers "done", but only after about 60 seconds without input.

Can I get notified only for permission prompts?

Yes. Set the Notification hook's matcher to permission_prompt. It fires when a permission prompt has waited about six seconds.

Do Claude Code hooks replace the built-in notification?

No. Hooks run alongside the built-in notification. If you get two notifications in Ghostty, Kitty or iTerm2, narrow or remove the hook, or turn off the terminal's own alerts.

Does terminal-notifier need special permissions?

It needs notification permission in System Settings like any app. Installing through Homebrew avoids the quarantine prompt that a downloaded binary triggers.

ALLOWBAR FOR MAC

Answer your agents from the menu bar.

Permission requests from Claude Code and Codex slide down from the top of your screen. Allow, Block or send back to the terminal. Allowbar never approves anything on its own.

Launch price $9.99 instead of $29.90, one-time purchase, lifetime license.