An always-on-top desktop widget that shows your AI coding usage for Claude, Codex, and Antigravity — at a glance.
AICycle Widget is a tiny, compact, always-on-top panel that unifies usage monitoring across Claude, OpenAI Codex, Grok, and Gemini. Each provider can be toggled on/off, every window shows how much you've used plus how long until it refreshes, and clicking a card opens a detail view with plan info and extra usage.
Inspired by OpenTokenMonitor and claude-usage-widget, rebuilt from scratch in Electron (Node only — no Rust toolchain required).
- 📊 Three providers, one widget — Claude, Codex, Antigravity, each independently toggleable.
- 🟢 Usage at a glance — each window (5H / 7D / credits) shows the used % with a matching bar.
- ⏱️ Time-to-refresh first — how much time is left is shown prominently, with the exact reset clock alongside.
- 🔍 Detail view — click any card for plan tier, extra usage / overage ($), credits, and account details.
- 🗜️ Three densities — the first title-bar button cycles normal → compact → super compact. Compact swaps the stacked cards for one icon per provider and a single row of slots; super compact drops the weekly row on top of that. With all four providers on that is 500px tall, then 159, then 116.
- 🌐 Auto language — UI follows your OS language (English / Korean); compact labels stay short (
5H,7D). - 🪶 Compact & always-on-top — auto-sizes to its content; lives in the corner without taking over your screen.
- ⚙️ Settings screen — always-on-top, launch-at-startup, 24-hour time, refresh interval, plus refresh / Claude logout / quit (open via the gear icon or the tray).
| Normal | Compact | Super compact |
|---|---|---|
![]() |
![]() |
![]() |
| Detail | Settings |
|---|---|
![]() |
![]() |
Each window shows the used % with a bar, the time until refresh, and the exact reset clock. Click a card for plan tier and extra usage; open the gear (⚙) for settings. The first title-bar button cycles the density — its icon loses a row at each step — and the compact layouts also narrow the window to whatever the enabled providers actually need.
All data is read locally / from the official services you're already signed into — nothing is sent anywhere.
| Provider | Source | Notes |
|---|---|---|
| Claude | claude.ai usage API via a one-time in-app login (sessionKey, persisted as a cookie) |
Shows 5H / 7D % + reset and extra usage (overage / prepaid). Not logged in → just a login button. |
| Codex | chatgpt.com/backend-api/codex/usage using the token in ~/.codex/auth.json |
Fetched through a hidden Chromium window (passes Cloudflare). Shows 5H / weekly % + reset, plan, credits. Falls back to local token counts from ~/.codex/logs_2.sqlite. |
| Grok | grok.com/rest/rate-limits via a one-time in-app login |
Fetched from inside the page so it carries the session. Shows the quota window (e.g. 2H) as used %, plus queries used / total. The endpoint reports the window length but no reset time, so the reset clock is estimated from when the window was first seen partly used. |
| Gemini | The Antigravity IDE's local Language Server (loopback, no extra auth) | Live only while the IDE is open; shows prompt/flow credit usage + reset and full plan details. When closed, the last fetched value is cached and shown. |
- Node.js 18+ (build/dev). The runtime bundles Electron 35 (Node 22) for built-in
node:sqlite. - Windows, macOS, and Linux. (Antigravity discovery uses
lsofon macOS/Linux — present by default on macOS, and on most Linux distros.)
npm install
npm run dev # launch the widget (development)
npm run build # production bundle
npm run package # Windows installer (nsis) via electron-builderOn first run, click "Log in to Claude (once)" to connect Claude. Codex works automatically if you're signed into the Codex CLI. For Antigravity, keep the IDE open.
src/
main/ Electron main: window, tray, polling, settings, i18n
collectors/ claude · claude-web · codex · codex-web · antigravity · types
preload/ contextBridge IPC
renderer/ React UI (Widget, DetailView, WindowBar, toggles)
shared/ i18n (shared by main + renderer)
- The Claude OAuth usage endpoint (
api.anthropic.com/oauth/usage) is heavily rate-limited and is not used; the widget uses theclaude.aiweb session instead. - Reading the session straight out of Chrome's encrypted cookie store is intentionally not implemented.
- The Gemini card reads the Antigravity IDE's language server, so it has no live data while that IDE is closed (the cached value is shown instead).
- Grok's quota endpoint is an internal grok.com API, not a documented one — it can change without notice.
- OpenTokenMonitor — multi-provider monitoring approach
- claude-usage-widget — claude.ai session usage approach
MIT



