Skip to main content

Beep when OpenAI Codex finishes a task or needs your input.

Project description

codex-bell

Get a beep when OpenAI Codex finishes a task or needs your input.


The problem

Codex runs tasks in the background and goes silent for minutes at a time. You end up tab-switching constantly just to check whether it's done — or you miss the moment it asks for input and the whole session stalls.

codex-bell watches your Codex session logs and fires a system beep the instant something needs your attention.


Install

pip install codex-bell

Then just run:

codex-bell

On first run, codex-bell looks for ~/.codex/sessions (the default path used by the Codex CLI on all platforms). If it can't find it, it will ask you where your sessions are and save the answer so you never have to type it again.


Usage

codex-bell [--path PATH] [--interval SECONDS] [--reconfigure]
Flag Description
--path PATH One-off override for the sessions directory
--interval N Polling interval in seconds (default: 2)
--reconfigure Forget saved path and prompt again

How it works

  1. Tails .jsonl files under your Codex sessions directory by tracking byte offsets — only new content is read on each poll.
  2. Detects three events: task_complete, request_user_input, and require_escalated.
  3. Fires a beep using the best available method for your OS (see table below).

Compatibility

OS Beep method
Windows winsound.Beep (built-in)
macOS afplay /System/Library/Sounds/Glass.aiff
Linux paplayaplay → ANSI terminal bell (fallback chain)
Other ANSI terminal bell (\a)

No external dependencies. Pure Python standard library + subprocess.


Why I built it

I was running long Codex sessions and kept missing the moment they finished — or the moment Codex stopped and waited for me. A proper notification felt like too much; I just wanted a beep. Spent an afternoon turning a quick winsound hack into something cross-platform and pip-installable.


Design note: polling vs. filesystem events

codex-bell polls every 2 seconds instead of using filesystem event APIs (like inotify on Linux or FSEvents on macOS). This was intentional:

  • Zero dependencies — no C extensions, no watchdog, no install pain.
  • Dead simple — one timer loop, easy to reason about.
  • Good enough — 2-second latency is imperceptible for "your agent finished a multi-minute task."

If you need sub-second reaction time, swap the loop in watcher.py for watchdog. For the use case this tool was built for, polling is the right call.


License

MIT © Kevin Defalco

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_bell-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_bell-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file codex_bell-0.1.0.tar.gz.

File metadata

  • Download URL: codex_bell-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codex_bell-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e15fbcf632e04624b2deb8841452ce207eba327efa85f9c670b5ce1d1f3cff9
MD5 e9b62de1b45757d3ffa9ed105e3c1f02
BLAKE2b-256 3e1bb74f2f0ce9e576d19b9b09fe38e5744b3a15a5a27509060f1d7deb07fa2b

See more details on using hashes here.

File details

Details for the file codex_bell-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: codex_bell-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codex_bell-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1d07f8b39ae17fa3776b58a2456ca959ebb8e37dd758c8e5d184406bae78aaa
MD5 358f53a4679ac7ecc4327c0ac56ae4c0
BLAKE2b-256 f35b5fd67331dcb0c420807c6ca500ffecc7b0ec4d90db6ab74c89c8e805d5bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page