gilvt
Claude Code guide

How to get notified when Claude Code needs your input

Claude Code often stops to ask for approval to run a command, and you are in a browser tab when it does. Here are the ways to find out right away on macOS, from a one-line setting to hooks, and where each runs out.

Short version: in Terminal.app and most other terminals Claude Code shows no desktop notification by default. Set Local notifications in /config to the terminal bell, or add a Notification hook (approvals, idle prompts) and a Stop hook (finished turns) that post a macOS notification. For Codex, use [tui] notifications or the notify program. With several sessions, you also need to know which one is asking and get there in one step.

What is worth a notification

Not every event deserves an interruption. In practice four are worth knowing about while you are in another app:

Option 1: Claude Code's built-in setting

Claude Code shows desktop notifications on its own only in iTerm2, Ghostty and Kitty. Everywhere else, open /config in Claude Code and change Local notifications (the preferredNotifChannel setting). terminal_bell rings the terminal bell, which most terminals turn into a sound or a bouncing Dock icon. The same setting in ~/.claude/settings.json:

{
  "preferredNotifChannel": "terminal_bell"
}

The other values are auto (the default), iterm2, iterm2_with_bell, kitty, ghostty and notifications_disabled. A bell tells you something happened, not what or where.

Option 2: hooks that post a macOS notification

Claude Code runs hooks on events. Two matter here:

Put them in ~/.claude/settings.json to cover every project:

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

The matcher field is optional: leaving it out of the Notification group matches every notification type, and Stop ignores it. The hook also receives the event as JSON on standard input, so a small script can put the project directory or the notification type in the message.

Codex

The Codex CLI has the equivalent in ~/.codex/config.toml. Its TUI can notify you itself, including for approval requests:

# ~/.codex/config.toml
notify = ["python3", "/Users/you/.codex/notify.py"]   # top-level keys come before any [table]

[tui]
notifications = ["agent-turn-complete", "approval-requested"]

The notify program runs when a turn completes (currently the only event it gets) and receives one JSON argument with fields such as type, cwd and last-assistant-message. See the Codex configuration docs for details.

Where do-it-yourself notifications run out

With one session, a hook is all you need. With four, the same notification arrives four times and raises new questions:

How gilvt does it

gilvt is a macOS terminal that tracks the state of every Claude Code and Codex session it runs, so it can notify you with the context a hook lacks. Nothing to configure: it injects its hooks when it starts the agent and does not edit ~/.claude or ~/.codex.

StateWhen you are notifiedSound
Awaiting approval / asking youImmediatelyYes
ErrorImmediatelyNo
Turn completedWhen the turn took 30 seconds or moreNo
Context 90% fullOnce per sessionNo
gilvt's sidebar with the sessions that need you grouped at the top.
When you come back, the sessions that notified you are waiting at the top of the sidebar.

The first time a session needs you, macOS asks whether gilvt may send notifications; choose Allow. You can change it later in System Settings → Notifications → gilvt.

Try it: download gilvt (free, macOS 11 or later), run claude in a pane, ask for something that needs approval and switch to another app.