Codex pets are tiny ambient companions for the work happening in Codex. This project adds one more layer to that idea: your pet can quietly show how much Codex capacity you have left, without turning the app into a dashboard.
The experience is a small macOS companion app. It watches where the Codex pet is, draws two polished rings around it, and keeps those rings attached to the pet as it moves. It does not patch Codex, change pet art, or modify the Codex app bundle.
It works with whatever Codex pet you like. Built-in pet, custom pet, tiny dog, robot, weather daemon, or anything else: the app does not care. It only follows the pet window that Codex is already showing.
The rings are designed to be glanceable:
- The outer ring shows the short-window limit remaining.
- The inner ring shows the weekly limit remaining.
- Color moves from calm green/blue to amber and red as capacity gets low.
- Hovering over the pet or rings shows the exact percentages at the current ring endpoints.
- A small menu-bar icon lets you hide the rings, refresh data, or quit.
When the Codex pet is closed, the rings disappear. When the pet comes back, they come back too. On multi-display setups, the rings stay with the pet instead of jumping to whichever screen is focused.
Because the rings are drawn in a separate transparent overlay, they do not need pet-specific sprites, masks, metadata, or configuration. Change pets in Codex and the rings follow the new one automatically.
The important design choice is the companion boundary. A menu item inside Codex itself would mean patching Electron app files and redoing that patch after app updates. That is brittle and hard to open source.
codex-pet-limit-rings stays outside the Codex app. It reads local Codex state, asks ChatGPT for live usage data using the local Codex/ChatGPT token, and renders its own transparent always-on-top window around the pet. The result is reversible, inspectable, and easy for another Codex agent to install or modify.
Install the rings as a login item:
tools/install-limit-rings.shYou should see a small rings icon in the macOS menu bar. Use that menu to toggle Show Rings, refresh the latest usage data, or quit.
Then use any Codex pet normally. No pet setup step is required.
Run a development build without installing the login item:
tools/run-limit-rings.shUninstall everything the installer adds:
tools/uninstall-limit-rings.shThis repository is structured so a Codex agent can pick it up from a GitHub link.
Ask the agent:
Use the bundled codex-pet-limit-rings skill from this repository. Install the rings companion for my Codex pet, verify the LaunchAgent is running, and confirm the rings stay anchored to the pet.
The agent should read:
AGENTS.mdfor the project contract.skills/codex-pet-limit-rings/SKILL.mdfor the install, debug, and validation workflow.docs/limit-rings.mdfor the data and rendering model.
To install the bundled skill into local Codex:
tools/install-codex-skill.shThe app reads only local Codex files and one ChatGPT usage endpoint:
~/.codex/.codex-global-state.jsontells it whether the pet is open and where it is.~/.codex/auth.jsonprovides the local bearer token used to read live usage from ChatGPT.~/.codex/logs_2.sqliteis used as a cached fallback if live usage is unavailable.
It does not require an OpenAI API key. It does not send pet images, screenshots, prompts, or repo contents anywhere.
tools/
codex-pet-limit-rings.swift native macOS companion app
install-limit-rings.sh build, install, and start at login
uninstall-limit-rings.sh remove the app and login item
run-limit-rings.sh development launch
build-limit-rings.sh app bundle builder
install-codex-skill.sh copy the bundled skill into ~/.codex/skills
skills/codex-pet-limit-rings/
SKILL.md Codex-agent workflow for this project
docs/
limit-rings.md implementation contract and data flow
experiments/weather-pets/
earlier weather-pet renderer kept as a separate experiment
Build the app:
tools/build-limit-rings.shRender a static preview PNG:
swiftc tools/codex-pet-limit-rings.swift -o tmp/codex-pet-limit-rings -framework AppKit -lsqlite3
tmp/codex-pet-limit-rings --preview tmp/limit-rings-preview.png --size 164Validate the shell scripts:
bash -n tools/*.shThe original exploration included a Python renderer for weather-mutated Codex pets. That work now lives under experiments/weather-pets/ so the public repo can stay focused on limit rings while preserving the larger idea: Codex pets can become ambient interfaces for state, context, and mood.
MIT. See LICENSE.
