Skip to content

Feature request: built-in notifications for CLI responses #4491

Closed

Description

@4minus1d

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.

Activity

  1. 4minus1d commented on Sep 30, 2025

    @4minus1d
    Author

    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

  2. dgunay commented on Sep 30, 2025

    @dgunay
  3. 4minus1d commented on Sep 30, 2025

    @4minus1d
    Author

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

  4. TomasHubelbauer commented on Mar 25, 2026

    @TomasHubelbauer

    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.

  5. etraut-openai commented on Mar 25, 2026

    @etraut-openai
    Contributor

    @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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions