{"slug": "get-notified-when-claude-code-needs-approval-or-finishes", "title": "Get notified when Claude Code needs approval or finishes", "summary": "A developer documented how Claude Code, Anthropic's terminal coding agent, signals when it finishes a task or pauses at a permission prompt while the user is away. The guide covers built-in desktop notifications in Ghostty, Kitty and iTerm2, push alerts from the Claude desktop app and Dispatch, the OSC 7501 Program Status Protocol supported in Claude Code 2.1.295 and later, and fallbacks such as terminal bells and custom Notification hooks. It also details tmux passthrough settings and the Apple Terminal configuration needed to hear an audible bell.", "body_md": "Claude Code sends a notification when it finishes a task or stops at a permission prompt while you seem to be away. You can show it as a desktop notification, a terminal bell, a push notification on your phone, or anything a Notification hook can run. Which one you need depends on your terminal and on how many sessions you run.\n\nIn Ghostty, Kitty and iTerm2, Claude Code sends a desktop notification by default when it detects them, though iTerm2 shows it only after you turn on its alert settings.\n\nIn iTerm2, open Settings > Profiles > Terminal, check Notification Center Alerts, then click Filter Alerts and enable Send escape sequence-generated alerts. Also confirm that your terminal application has notification permission in your OS settings.\n\nOver SSH from a terminal running outside tmux, set `preferredNotifChannel` to `\"iterm2\"`, `\"kitty\"` or `\"ghostty\"` on the machine running Claude Code so the desktop notification reaches your local machine.\n\nIn the Claude desktop app, the Code tab sends its own desktop notification when a session finishes a task while you're not viewing it. A session you start from Dispatch on your phone sends a push notification there when it finishes or needs your approval.\n\nFor Code tab sessions that belong to a project in the Claude Desktop app, you get the project's notifications instead.\n\nIf your terminal implements the OSC 7501 Program Status Protocol, Claude Code 2.1.295 or later also reports whether each interactive session is working, waiting on you or done, with nothing to turn on. Your terminal's documentation says whether it supports the protocol and where it shows the status.\n\nInside tmux, Claude Code checks tmux for OSC 7501 support instead of your terminal, and `allow-passthrough` has no effect on that, so start the session outside tmux. Background sessions do not report status to your terminal, and setting `CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1` stops Claude Code from checking for support or reporting status.\n\nOther terminals, such as Apple Terminal, Warp or the VS Code terminal, don't get the desktop notification. Ask for a bell instead. Add this to `~/.claude/settings.json`:\n\n```\n{\n  \"preferredNotifChannel\": \"terminal_bell\"\n}\n```\n\nIn Apple Terminal, Claude Code sends no sound by default: it sends a silent bell character when `Audible bell` is off in the front Terminal window's profile, and nothing otherwise. That bell character shows as a window flash, or a Dock bounce while Terminal is in the background, if that profile's `Visual bell` or Dock bounce option is on. Accepting Claude Code's first-run terminal setup prompt runs `/terminal-setup`, which turns off the audible bell in your Apple Terminal profile unless screen reader mode is active. To hear the bell in Apple Terminal, set `preferredNotifChannel` to `\"terminal_bell\"` and turn on `Audible bell` under `Settings > Profiles > Advanced`.\n\nIf you use tmux, add `set -g allow-passthrough on` to `~/.tmux.conf` so the notification reaches the outer terminal.\n\nRun `tmux source-file ~/.tmux.conf` to apply the change to the running server, and set `preferredNotifChannel` to `\"iterm2\"`, `\"kitty\"` or `\"ghostty\"` to send notifications from a visible pane to the outer terminal. A pane in a window you aren't viewing sends none.\n\nIf your sessions run inside Windows Subsystem for Linux, see [Claude Code WSL notifications: get alerts on Windows](https://orbtile.com/guides/claude-code-wsl-notifications?s=devto-cc-notify) for Windows Terminal bell settings and PowerShell hooks.\n\nA Notification hook runs a custom command when Claude needs your attention, such as playing a sound or sending a desktop notification. It runs alongside the built-in notification rather than replacing it. On macOS, this plays a system sound:\n\n```\n{\n  \"hooks\": {\n    \"Notification\": [\n      {\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"afplay /System/Library/Sounds/Glass.aiff\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\nClaude Code fires the same hook events wherever it runs: in the terminal, IDE extensions, the Desktop app and cloud sessions. To send a desktop banner instead, use your platform's notification command in a `Notification` hook in `~/.claude/settings.json`:\n\n`osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'` in the hook command.`osascript` routes notifications through Script Editor, which needs notification permission.`osascript -e 'display notification \"test\"'` once in Terminal, then turn on `Allow Notifications` for `Script Editor` in `System Settings > Notifications`.` notify-send 'Claude Code' 'Claude Code needs your attention'` in the hook command.`notify-send` needs a desktop notification daemon.`libnotify-bin` package.`powershell.exe -Command \"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('Claude Code needs your attention', 'Claude Code')\"` in the hook command.\nThe Notification event fires on every notification type when `matcher` is empty, or you can filter it to specific types such as `permission_prompt` or `idle_prompt`. A separate `Stop` hook fires whenever Claude finishes responding, not only at task completion, while a `PermissionRequest` hook fires when a tool call needs a permission decision. See [Know when Claude Code asks you a question or wants a plan approved](https://orbtile.com/guides/claude-code-questions-and-plan-approval?s=devto-cc-notify) for question and plan approval hooks.\n\n| Hook event or `Notification` matcher | When it fires | \n|---|---|\n| `permission_prompt` (`Notification` ) | Claude needs approval for a tool use or a sandboxed command's network request, and the prompt has waited about six seconds | \n| `idle_prompt` (`Notification` ) | Claude finished responding about 60 seconds ago and you haven't typed since | \n| `elicitation_dialog` (`Notification` ) | An MCP server opens an elicitation form and you haven't typed for about six seconds | \n| `elicitation_url_dialog` (`Notification` ) | An MCP server asks you to open a browser URL and you haven't typed for about six seconds | \n| `agent_needs_input` (`Notification` ) | A background session starts waiting on your input while agent view is open | \n| `agent_completed` (`Notification` ) | A background session finishes or fails while agent view is open | \n| `Stop` (hook event, no matcher) | Claude finishes responding. It doesn't fire on a user interrupt, and an API error fires `StopFailure` instead | \n| `PermissionRequest` (hook event) | A tool call needs a permission decision | \n\nIf you run background sessions, agent view also notifies you while it's open when one of them starts waiting on your input, finishes or fails. It fires the Notification hook with the `agent_needs_input` or `agent_completed` type, so a hook script can react to those too. See [Claude Code agent view: run and watch background sessions](https://orbtile.com/guides/claude-code-agent-view?s=devto-cc-notify) for how to start background sessions and reply to them.\n\nTo see how `Notification` fits alongside `PreToolUse`, `PostToolUse`, `Stop` and the other hook events, read [Claude Code hooks: events, matchers, settings and handlers](https://orbtile.com/guides/claude-code-hooks?s=devto-cc-notify).\n\nThe Claude app for iOS and Android can receive push notifications for sessions running on your computer:\n\n`claude remote-control`, or run `/remote-control` inside an open session.`Connect new sessions to Remote Control` in `Settings > Code` or `Settings > Claude Code`.` remoteControlAtStartup` setting connects Remote Control automatically when a session starts.`notify me when the tests finish`.` inputNeededNotifEnabled` setting gets you a push notification when Claude is waiting on you.`agentPushNotifEnabled` setting lets Claude send a push notification to your phone when it decides to.\n| You run | Use | \n|---|---|\n| One session, Ghostty, Kitty or iTerm2 | Built-in desktop notifications | \n| One session, another terminal | `terminal_bell` | \n| You want a sound or a custom action | A Notification hook | \n| You're away from your computer | Remote Control push notifications | \n| Several sessions at once | A display that shows which session is waiting | \n\nA notification says that a session needs you. With four sessions open, you still have to find which one, and once you dismiss the banner it's gone.\n\nFor a wider comparison of tmux, hooks, agent view, IDE panels and status pads, see [How to monitor multiple Claude Code sessions](https://orbtile.com/guides/monitor-multiple-claude-code-sessions?s=devto-cc-notify).\n\nI built Orbtile for this: it shows every session as its own tile on an iPhone, an Android phone or the Logitech MX Creative Keypad. A waiting session glows in its agent's alarm colour and moves to the front, the tile shows what it's asking, and you can answer supported requests from the pad: press Deny, or hold Allow for 0.6 seconds. It uses Claude Code's hooks through its own plugin, so your notifications keep working as before.\n\nIf you also run Kimi Code, see [Kimi Code notifications: hooks, NotifyUser and TUI settings](https://orbtile.com/guides/kimi-code-notifications?s=devto-cc-notify) for how its hooks and progress updates work.\n\n**See which session needs you.** [Download Orbtile for Mac or Windows](https://orbtile.com/download?s=devto-cc-notify)\n\n**Why don't I get notifications in the VS Code terminal?**\n\nIt doesn't receive Claude Code's desktop notification. Set preferredNotifChannel to terminal_bell, or add a Notification hook.\n\n**Can I get notified only for permission prompts?**\n\nYes. Give the Notification hook a matcher of permission_prompt.\n\n**How do I get an alert every time Claude finishes responding?**\n\nThe idle_prompt notification type waits about 60 seconds after Claude finishes responding. A Stop hook in your settings.json file fires whenever Claude finishes responding, so use one for an alert at the end of every turn.\n\n**Does Orbtile change my Claude Code settings?**\n\nIt installs its plugin through Claude Code's own command line. If that fails, it edits your Claude settings.json file and keeps a dated backup first. Removing the plugin in Orbtile's settings unregisters it.\n\nOriginally published at [https://orbtile.com/guides/claude-code-notifications?s=devto-cc-notify](https://orbtile.com/guides/claude-code-notifications?s=devto-cc-notify)", "url": "https://wpnews.pro/news/get-notified-when-claude-code-needs-approval-or-finishes", "canonical_source": "https://dev.to/diogo_mendes_13ae8cdfc61e/get-notified-when-claude-code-needs-approval-or-finishes-49bf", "published_at": "2026-11-27 22:06:34+00:00", "updated_at": "2026-11-27 22:14:19.566450+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Claude Code", "Anthropic", "iTerm2", "Ghostty", "Kitty", "tmux", "Apple Terminal", "Windows Subsystem for Linux"], "also_reported_by": [], "takeaway": "Claude Code 2.1.295+ reports per-session working/waiting/done status via the OSC 7501 protocol in supporting terminals, but inside tmux it checks tmux rather than the outer terminal, so start the session outside tmux for status reporting.", "recommendation": {"advice": "Set preferredNotifChannel to iterm2, kitty or ghostty and enable tmux allow-passthrough so coding-agent approval prompts reach you; use a Notification hook or terminal bell where desktop alerts aren't supported.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/get-notified-when-claude-code-needs-approval-or-finishes", "markdown": "https://wpnews.pro/news/get-notified-when-claude-code-needs-approval-or-finishes.md", "text": "https://wpnews.pro/news/get-notified-when-claude-code-needs-approval-or-finishes.txt", "jsonld": "https://wpnews.pro/news/get-notified-when-claude-code-needs-approval-or-finishes.jsonld"}}