Skip to main content

macOS menu bar widget for Codex weekly and 5-hour limit burn rates.

Project description

CodexLimit

CodexLimit is a macOS menu bar widget that reads local Codex session logs, shows the weekly non-Spark Codex limit burn rate as a status item title, and graphs both the weekly and 5-hour limits in the popover.

The app does not call a network API. It reads CODEX_HOME or ~/.codex/sessions, records samples in:

~/Library/Application Support/CodexLimit/samples.jsonl
~/Library/Application Support/CodexLimit/five_hour_samples.jsonl

Install for Development

python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[packaging]"

Install from PyPI

pip install "codex-limit[app]"
codex-limit-install --user

That builds CodexLimit.app, installs it to ~/Applications, and launches it. Use codex-limit-install --system to install to /Applications.

You can also run it directly as a Python menu-bar process:

codex-limit

Run

python -m codex_limit

Click the menu bar title to open the graph popover. The title is the current weekly burn multiple, where 1.0x means weekly quota is being consumed at the real-time replenishment pace. The popover shows a blue weekly graph and a green 5-hour graph, each with current used/left percentages and estimated time to zero.

If either tracked limit is projected to hit zero within 30 minutes while its reset is still more than 30 minutes away, the menu bar title and that limit's ETA show a warning marker.

The burn multiple averages weekly-limit usage over the shorter of the last two hours or the current 5% burst. If Codex has not written a newer rate-limit event by the next poll, CodexLimit extends the graph with an assumed flat sample so idle time counts as no additional usage. Those assumed samples are not persisted as real observations and are ignored as lower baselines when a later Codex log reveals a percentage jump.

CodexLimit keeps an in-process cache of parsed session-log samples. Each poll still checks the session tree for new or modified JSONL files, but unchanged files are not reparsed and growing files are read only from their appended tail.

Build a macOS App Bundle

python setup.py py2app
open dist/CodexLimit.app

The bundle is configured as a menu-bar-only accessory app and should not show a Dock icon. The app icon is generated from assets/CodexLimit.icns.

Install Locally

scripts/install.sh

The installer builds dist/CodexLimit.app, stops any running copy, installs to /Applications when writable or ~/Applications otherwise, and launches the app. Use scripts/install.sh --user to force ~/Applications, or scripts/install.sh --no-open to install without launching.

Test

python -m unittest discover -s tests

Release

Publishing uses the local release flow from this machine:

python -m pip install --upgrade build twine
rm -rf dist build
python -m build
python -m twine check dist/*
python -m twine upload --non-interactive dist/*.tar.gz dist/*.whl

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_limit-0.2.2.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

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

codex_limit-0.2.2-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file codex_limit-0.2.2.tar.gz.

File metadata

  • Download URL: codex_limit-0.2.2.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codex_limit-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3d5f9fe31b497a8b4872191da19ca6a600a7e686aee521800a926990639c60b3
MD5 46c1938bd81e83b67ce017dbf54606df
BLAKE2b-256 728654851f869999b5cb92913c9c35ff316b0c7b9c39109b33f1327a35f62f6b

See more details on using hashes here.

File details

Details for the file codex_limit-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: codex_limit-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codex_limit-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 99727653e652a197b45c3f2ab792ffdbf0e8196d57180b26001fa85d56313983
MD5 da409326e8e9ed89525d81c9ec3815e5
BLAKE2b-256 82f839d5b3877727d0ddefbd90db0c823d7568e77f5eba3fbc067770421e61b4

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