Skip to content

adamholter/codex-pet-limit-rings

 
 

Repository files navigation

codex-pet-limit-rings

Turn your Codex pet into a live limit meter.

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.

Codex Pet Limit Rings around a Codex pet

Why This Is Useful

  • No Codex patching: the rings are a separate native macOS companion app.
  • Works with any pet: the overlay follows Codex's pet window instead of editing sprites.
  • Uses live data when available: the app reads the same local auth context Codex already uses for usage checks.
  • Still works when live reads fail: it falls back to the local Codex rate-limit log.
  • Easy to install or remove: login-item install, menu-bar control, and clean uninstall scripts are included.

What You See

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.

Why It Works This Way

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, uses the same local auth context Codex already has for live usage reads, 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.

Quick Start

Install the rings as a login item:

tools/install-limit-rings.sh

You 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.sh

Uninstall everything the installer adds:

tools/uninstall-limit-rings.sh

Give This Repo To Codex

This 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.md for the project contract.
  • skills/codex-pet-limit-rings/SKILL.md for the install, debug, and validation workflow.
  • docs/limit-rings.md for the data and rendering model.

To install the bundled skill into local Codex:

tools/install-codex-skill.sh

Data And Privacy

The app reads only local Codex state plus the same live usage endpoint Codex relies on:

  • local Codex UI state to tell whether the pet is open and where it is
  • local Codex auth state for live usage reads
  • a local Codex rate-limit log as cached fallback when live usage is unavailable

It does not require an OpenAI API key. It does not send pet images, screenshots, prompts, or repo contents anywhere.

Project Shape

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

Development

Build the app:

tools/build-limit-rings.sh

Render 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 164

Validate the shell scripts:

bash -n tools/*.sh

Experiments

The 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.

License

MIT. See LICENSE.

About

Turn your Codex pet into a live usage-limit meter.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Swift 60.4%
  • Python 35.5%
  • Shell 4.1%