Feature request: built-in notifications for CLI responses

Resolved 💬 5 comments Opened Sep 30, 2025 by 4minus1d Closed Nov 14, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

### Summary

Provide a built-in way for Codex CLI to trigger desktop notifications (or expose an event stream) whenever the assistant finishes a response.

Motivation

I am using Codex CLI 0.42.0 on Windows and would like a toast notification each time the assistant replies. I tried implementing this by tailing .codex/sessions/*.jsonl and watching for agent_message events, but the current approach is fragile:

  1. The CLI writes large base64 payloads into the session logs, which causes Windows Defender to quarantine the active .jsonl file as TrojanDownloader:VBS/Powdown.D!MSR.
  2. Once Defender takes action, any watcher loop starts throwing Access is denied errors and stops delivering notifications.
  3. Because the session logs are only intended for archival, there is no supported hook or API to stream responses in real time without touching those files.

Desired solution

Add an official notification feature (for example a --notify flag that fires a toast on Windows/macOS/Linux) or expose a stable event stream/pipe that external tooling can consume without having to touch the session archives.

Additional context

  • Codex CLI 0.42.0
  • Windows Security quarantines the session JSON; repeated accesses then fail with Test-Path : Access is denied.
  • A builtin option would avoid security false positives and make the feature reliable for everyone.

View original on GitHub ↗

5 Comments

4minus1d · 11 months ago

Temporary solution / tip for anyone else interested:

Ask codex to "trigger a windows toast notification at the end of each response" in your prompt - You do it once and it remembers to notify you after every response in that session.

Only tested with these parameters in powershell: codex -a never -s danger-full-access

dgunay · 11 months ago
4minus1d · 11 months ago

Thats exactly what I was looking for, thanks :) Had no idea this existed

TomasHubelbauer · 5 months ago

The notify hook is cool, but would it make sense to have OS-native desktop notifications out of the box, too? Seems like a useful, table-stakes, feature.

etraut-openai contributor · 5 months ago

@TomasHubelbauer, the CLI does support OS_native desktop notifications using the tui. notifications setting. It relies on your terminal to support OSC9 escape sequences and call the OS notification mechanism. If your terminal doesn't support this feature, then it falls back on a simple beep (BEL character).