← Doki

How to get notified when Claude Code finishes on a Mac

By , maker of Doki · Updated 22 November 2026

Claude Code can tell you when it's done, but it doesn't out of the box in every terminal. There are four ways to set it up on a Mac. Three are free and built in; the fourth is Doki, which we make.

The short answer

Add a Stop hook to ~/.claude/settings.json. Claude Code runs it every time it finishes responding, and the hook can show a macOS banner with osascript. Add a Notification hook as well, because Stop doesn't run when Claude is waiting for your permission. If you'd rather not edit settings, or you run several sessions at once and want to know which one finished and what it did, use an app such as Doki.

The four ways, side by side

WaySetupWhen Claude is doneWhen Claude needs youSays which session and what changed
1. Your terminal's own alertNone, or one settingYesYesNo
2. A Stop hookEdit a settings fileYesNoOnly if you script it
3. A Notification hookEdit a settings fileAbout a minute laterYes, after about six secondsOnly if you script it
4. DokiOne clickYesYesYes

1. Your terminal's own alert

In Ghostty, Kitty and iTerm2, Claude Code sends a desktop notification by itself when it finishes or needs you, as long as the terminal is allowed to show notifications in System Settings. In other terminals, such as Terminal.app, you can ask for a bell instead. Add this to ~/.claude/settings.json:

{
  "preferredNotifChannel": "terminal_bell"
}

This is the least work, and it's enough if you run one session at a time. The alert doesn't say what Claude did. The details are in Claude Code's terminal setup docs.

2. A Stop hook: a banner the moment Claude is done

A hook is a command Claude Code runs at a set moment. The Stop hook runs when Claude finishes responding. This one shows a macOS banner and plays a sound. Put it in ~/.claude/settings.json:

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

Three things to know:

To check it's in place, type /hooks in Claude Code. That screen lists your hooks; it can't add or change them.

3. A Notification hook: when Claude needs you

The Notification hook runs when Claude Code wants your attention. The two cases that matter here are permission_prompt (Claude needs you to approve something, and the prompt has waited about six seconds) and idle_prompt (Claude finished about a minute ago and you haven't typed since). This hook covers permission prompts only:

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

Use it together with the Stop hook: both go inside the same hooks section. Leave the matcher empty ("") to get every kind of notification. The full list of events is in Claude Code's hooks reference, and our guide Claude Code hooks explained covers the ones that matter, with more examples.

4. Doki: the alert comes to you, and says what happened

Doki is a desktop pet for Mac. It uses the same hooks as above, but sets them up for you and does more with them:

Doki's agent alerts, Claude Code included, are free for your first week. $7.69 once keeps them on and unlocks every pet. It works with Codex, Cursor and Gemini CLI too. It needs macOS 13 or later. Download Doki, or see the FAQ.

Which one should you use?

Want alerts on your phone, or a menu bar app instead? See Claude Code notification tools compared.

Questions

Why doesn't my Stop hook fire when Claude asks for permission?

Because Claude hasn't finished; it's waiting. Permission prompts arrive through the Notification hook, as permission_prompt, after the prompt has waited about six seconds.

Why does my osascript notification not show up?

Most often Script Editor isn't allowed to show notifications, or a Focus mode is on. Open System Settings, then Notifications, and allow Script Editor. Running the osascript command by hand in Terminal is a quick test.

Do hooks slow Claude Code down?

A hook that shows a banner returns straight away. A hook that waits on something slow can hold Claude up, which is why Doki's hook gives up after two seconds.

Does this work with Claude Code in VS Code and the Claude app?

Hooks live in ~/.claude/settings.json, so they run wherever Claude Code runs on your Mac. Doki works with sessions in Terminal, VS Code, Cursor and other editors. Sessions that run in the cloud, or in the Claude app's sandbox, run somewhere else and can't reach Doki yet.