All guides

Codex notifications in VS Code, Cursor and JetBrains

Updated 19 November 2026 · 4 min read

When you run the Codex CLI in the integrated terminal of VS Code, Cursor, Windsurf or a JetBrains IDE, its built-in alert is only the terminal bell, because Codex sends desktop notifications only to terminals that support OSC 9. To get a real alert, add a Stop hook (and a PermissionRequest hook for approvals) to ~/.codex/hooks.json that shows a desktop notification or sends a push, and trust them with /hooks. Hooks run from Codex, not from the terminal, so they work in any IDE terminal. The Codex IDE extension's chat panel is a separate client with no notification settings of its own; OpenAI suggests the notify setting there.

01The CLI in an IDE terminal

Codex's built-in notification picks its method from the terminal. VS Code's terminal (and the editors built on it, such as Cursor and Windsurf) isn't one of the terminals Codex sends OSC 9 to, so with the default notification_method = "auto", Codex rings the bell instead. By default it also only does that when the terminal is unfocused.

What happens with the bell depends on the editor:

  • VS Code and Cursor: the terminal can play a sound or show a bell icon on the terminal tab. Look for the terminal bell and accessibility signal settings (search Settings for "bell"). Neither is a system notification.
  • JetBrains IDEs: the terminal handles the bell according to its own settings; it won't raise a system notification either.

So in an IDE terminal, the built-in alert helps only if you're looking at the editor. The built-in notifications guide explains the [tui] settings.

02A hook works in every IDE terminal

Hooks run from Codex itself. Wherever you start codex, the same ~/.codex/hooks.json is read, so a hook gives you a real desktop notification in VS Code, Cursor, Windsurf, JetBrains IDEs and any other terminal.

On macOS:

{
  "hooks": {
    "Stop": [
      { "hooks": [ { "type": "command", "command": "osascript -e 'display notification \"Codex has finished\" with title \"Codex\"' >/dev/null" } ] }
    ],
    "PermissionRequest": [
      { "hooks": [ { "type": "command", "command": "osascript -e 'display notification \"Codex wants your approval\" with title \"Codex\"' >/dev/null" } ] }
    ]
  }
}

Swap the command for notify-send 'Codex' 'Codex has finished' on Linux, or a PowerShell toast on Windows (see the Windows guide). Then start codex in the IDE terminal, run /hooks and trust both entries.

To make a click on the notification bring the editor forward on a Mac, use terminal-notifier with -activate com.microsoft.VSCode (or Cursor's bundle id). The macOS guide shows how.

03The Codex IDE extension

The Codex extension for VS Code, Cursor and Windsurf (and Codex in JetBrains and Xcode) is a chat panel, not a terminal, so terminal bells and OSC 9 don't apply. OpenAI's docs say the extension has no separate notification controls: keep the chat open to follow it, and to run a program when a turn completes, configure notify in ~/.codex/config.toml on the Codex host. The notify guide has a script that shows a desktop notification on Mac, Windows and Linux.

Whether your hooks also fire for chats in the extension depends on your Codex version and setup, so test it before relying on it.

04Remote development

With VS Code Remote SSH, Dev Containers or WSL, the integrated terminal runs on the remote side, and so does codex and its hooks. A notify-send or osascript hook there has no desktop to show anything on. Use a network push (ntfy, a chat webhook or a phone app) from the remote side instead. Notifications over SSH covers it.

05On your phone

When you leave the desk, editor alerts can't follow. Notifier for Codex's free codex-notifier tool for Mac, Windows and Linux installs its hooks once, marks them trusted, and from then on every codex session in any terminal, including IDE terminals and remote ones, can send "finished", approvals and questions to an iPhone or Android app, where you can answer. It supports the Codex CLI; the IDE extension's chat panel isn't supported. Notifier for Codex is independent and not affiliated with OpenAI.

06FAQ

Why does Codex beep in VS Code instead of showing a notification?

VS Code's terminal isn't one of the terminals Codex sends OSC 9 notifications to, so it falls back to the bell. Use a hook for a real notification.

Can I force OSC 9 in the VS Code terminal?

You can set notification_method = "osc9", but the terminal has to understand the sequence for anything to appear. Test it; if nothing shows, use a hook.

Do I need separate hooks for the IDE terminal?

No. The CLI reads the same ~/.codex/hooks.json in every terminal.

Does the Codex extension use my notify setting?

OpenAI's docs point extension users to notify on the Codex host, which is your ~/.codex/config.toml for local work.

Notifier for Codex Get a push on your phone when Codex finishes or needs you, then approve, reject or answer from there. The codex-notifier command line tool is free on Mac, Windows and Linux.