Codex Pet Limit Rings
Core Rule
Keep the Codex desktop app unpatched by default. Ship and modify the rings as a companion macOS app that reads local Codex state and exposes its own menu-bar icon. Only discuss direct Codex app menu patching as a brittle optional route, because it requires app.asar patching, Electron integrity updates, and re-signing after Codex updates.
The rings are pet-agnostic. Do not add pet-specific setup unless a user explicitly asks for a custom visual treatment; by default the overlay follows whatever Codex pet is currently active.
Locate The Project
If this skill is bundled in the repository, the project root is two directories above this SKILL.md. Otherwise find or ask for a checkout containing:
tools/codex-pet-limit-rings.swift
tools/install-limit-rings.sh
tools/run-limit-rings.sh
Use that checkout as the working directory. Read AGENTS.md first if it exists.
Common Tasks
Install or enable the rings for a user:
tools/install-limit-rings.sh
Run a development build without installing a login item:
tools/run-limit-rings.sh
Uninstall:
tools/uninstall-limit-rings.sh
Install this skill into local Codex:
tools/install-codex-skill.sh
Verify the live app:
pgrep -fl CodexPetLimitRings
launchctl print "gui/$(id -u)/com.codex-pet.limit-rings" >/dev/null
Data Contract
The rings read:
~/.codex/auth.jsonfor a local ChatGPT access token, thenhttps://chatgpt.com/backend-api/wham/usagefor live usage data.~/.codex/.codex-global-state.jsonforelectron-avatar-overlay-openandelectron-avatar-overlay-bounds.mascot.~/.codex/logs_2.sqlitefor fallback to the newestcodex.rate_limitsevent when live usage fails.
The outer ring is the short-window remaining percentage. The inner ring is the weekly remaining percentage. The menu summary should say Live when direct usage succeeds and Cached when the local log fallback is active.
Pet wakeups and moves are driven by a filesystem watcher on ~/.codex/.codex-global-state.json, with a slow fallback timer for missed events. Keep that event-driven path intact when changing frame-following behavior.
Editing Workflow
When changing behavior or visuals:
- Edit
tools/codex-pet-limit-rings.swift. - Keep packaging scripts in
tools/and updatedocs/limit-rings.mdwhen the user-facing contract changes. - Run:
bash -n tools/*.sh
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 164
- Relaunch with
tools/run-limit-rings.shfor development ortools/install-limit-rings.shfor the packaged login-item flow.
Open-Source Hygiene
Keep the app privacy-preserving, source-buildable, and uninstallable. Do not commit local tmp/ builds, logs, derived pet spritesheets, or user-specific Codex data. Preserve the MIT license and document any new local files or permissions in docs/limit-rings.md.
Source: petergpt/codex-pet-limit-rings — distributed by TomeVault.