Skip to content

About

Borderless Windows HUD & CLI quota monitor for Claude Code, ChatGPT Codex, Grok, Google Antigravity (agy), Magpie & LiteLLM. Tracks multi-account 5h/7d rate-limit windows, redeems Claude/Codex limit-reset credits, and doubles as an mpv live wallpaper.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usage-float

A headless multi-subscription quota collector for coding-agent routing workflows: a CLI (python usage_float.py once), a local JSON telemetry cache (~/.usage-float/usage-cache.json) and a check-quota Agent Skill that let Claude Code, Codex, Antigravity, Paseo and routers read live 5-hour and 7-day rate-limit windows and reset timers across Claude Code (Claude Max / Pro), OpenAI Codex CLI / ChatGPT Pro, Grok, Google Antigravity (agy / Gemini CLI), and Magpie, plus spent dollars for a metered USD API account. It also ships a borderless Windows desktop quota HUD (no title bar, no taskbar entry), an auxiliary-screen dashboard, and an optional live-wallpaper player toggled with a double-tap of Ctrl.

  • Multi-Account Local Quota Discovery: Reads multiple local credentials (~/.claude, ~/.claude-2, ~/.claude-*, ~/.codex, ~/.codex-2, ~/.codex-*, ~/.grok, agy, Paseo provider directories, and remote Magpie /v1/magpie/quotas) directly on your machine without rotating OAuth tokens.
  • One-Click Rate-Limit Reset Redemption: Inspects and redeems Claude weekly rate-limit resets (cedar_ember), Claude 5-hour session wall resets (juniper_tide), and ChatGPT / Codex rate-limit reset credits (/backend-api/wham/rate-limit-reset-credits) directly from the HUD.
  • Headless CLI & JSON Cache for Agents: Run python usage_float.py once (or read ~/.usage-float/usage-cache.json) from scripts, routers, or coding agents to query remaining subscription percentages and reset timestamps programmatically.

For Coding Agents (Skill & JSON Cache Schema)

Skill: skills/check-quota/SKILL.md teaches an agent to check subscription headroom before dispatching a sub-agent or starting long work. Copy or link the skills/check-quota folder into your host's skills directory (for example ~/.claude/skills/check-quota, ~/.codex/skills/check-quota).

Headless CLI: python usage_float.py once (release binary: UsageFloat.exe once) queries each signed-in provider once and prints one line per window with usage and time to reset. No UI is opened.

JSON cache: the same readings are persisted to ~/.usage-float/usage-cache.json (atomic writes under a file lock), so an agent can read quota without any network call. Abbreviated example (illustrative values):

{
  "providers": {
    "claude": {
      "provider_id": "claude",
      "display_name": "claude",
      "plan_label": "max",
      "windows": [
        {"id": "seven_day", "label": "7d", "used_pct": 42.0, "resets_at": "2026-11-05T21:00:00+00:00"},
        {"id": "five_hour", "label": "5h", "used_pct": 8.0, "resets_at": "2026-10-30T08:00:00+00:00"}
      ],
      "error": null,
      "available": true,
      "stale": false,
      "fetched_at": "2026-10-30T03:21:28+00:00",
      "summary": null
    },
    "codex": {"provider_id": "codex", "plan_label": "pro", "windows": [{"id": "usage", "label": "7d", "used_pct": 93.0, "resets_at": "2026-11-04T06:35:27+00:00"}], "stale": false}
  }
}
Field Meaning
providers.<id> One entry per account (claude, claude-2, codex, codex-2, grok, antigravity, llmproxy, ...)
windows[].id / label Window identifier and display label, for example seven_day / 7d, five_hour / 5h, weekly_fable / fable 7d, gemini-weekly / gemini 7d
windows[].used_pct Percent of the window already used (0-100); remaining headroom is 100 - used_pct
windows[].resets_at ISO-8601 time the window resets
plan_label Subscription tier when known (for example max, pro)
fetched_at, stale, error Freshness of the reading; stale: true or a non-null error means the last refresh failed and the numbers are older
summary Spent-dollar figure for a metered USD account, for example 已用 $2.65 / $200 or 已用 $12.30

The cache also holds bookkeeping keys (display_snapshots, attempts, poll, per-provider *_backoff_until) that consumers can ignore.

With AgentCompass: AgentCompass (agent-compass) reads ~/.usage-float/usage-cache.json to score task difficulty against live quota windows and pick the best-fit account, model and effort. Usage Float also runs on its own with no AgentCompass installed.

AgentCompass integration

AgentCompass uses Usage Float as its subscription quota collector and optional floating HUD. Usage Float also runs independently; AgentCompass adds task routing, quota scheduling, and a Windows management panel.

Screenshots

Dedicated auxiliary-screen usage dashboard:

Dedicated auxiliary-screen usage dashboard

Usage settings (two-column drag-and-drop layout; unchecked items are dimmed in place):

Usage settings

Auxiliary display and shortcut settings:

Auxiliary display and shortcut settings

Live wallpaper folders and recursion depth (instant add, background indexing, middle-segment path truncation):

Live wallpaper folder settings

Live wallpaper folder random weights:

Live wallpaper random weights

Installation & Quick Start

Release package (recommended): Download usage-float-*-windows-x64.zip from the repository's Releases page, extract it, and run UsageFloat.exe. No Python installation is required (mpv is bundled). If Windows SmartScreen prompts on an unsigned binary, choose More info → Run anyway. Toggle Start at login from the right-click context menu.

Run from source: Requires Windows + Python 3.10+ (with tkinter). Video wallpapers need mpv: Usage Float downloads the pinned, SHA-256-verified build into ~/.usage-float/runtime/mpv in the background the first time a wallpaper needs it (progress and a retry button are under Settings › Live Wallpaper). python mpv_provision.py or .\install-mpv.ps1 (into vendor/mpv/) install it ahead of time.

python usage_float.py once          # Print a one-shot CLI usage summary (release binary: UsageFloat.exe once)
pythonw usage_float.py              # Launch floating HUD / auxiliary-screen panel
.\start.vbs                         # Launch detached from the current shell session
python usage_float.py autostart on  # Enable startup at Windows logon

Credentials & Dynamic Account Discovery

All credentials stay on your local machine and are read directly without third-party servers:

Provider Default Local Credential Source
Claude ~/.claude/.credentials.json
Additional Claude Accounts ~/.claude-2/.credentials.json (CLAUDE_HOME_2), ~/.claude-*, or Paseo provider CLAUDE_CONFIG_DIR bindings
Codex ~/.codex/auth.json
Additional Codex Accounts ~/.codex-2/auth.json (CODEX_HOME_2), ~/.codex-*, or Paseo provider CODEX_HOME bindings
Grok ~/.grok login state
Antigravity Official agy CLI (1.1.11+) login state via PATH, %LOCALAPPDATA%\agy\bin\agy.exe, or ANTIGRAVITY_CLI_PATH
Metered USD AgentCompass accounts-override.json entry with billing: metered, endpoint, api_key, and optional budget_usd

Signing in to a Second Codex Account

$env:CODEX_HOME="$env:USERPROFILE\.codex-2"; codex login

Grok and Grok Bot share one meter

On 2026-10-29 the user confirmed both official apps show the same subscription usage (56%). The Grok row includes Grok Bot consumption. Only the Grok billing observation is collected; there is no separate Bot row or native Bot cache reader. An enabled legacy Bot display selection maps to the ordinary Grok entry, even if the old Grok selection was disabled. Duplicate fetches collapse to one Grok read; the retired Bot display entry disappears. No special shared-pool label is added.

Remote Magpie Subscription Quotas

When a Claude subscription is hosted behind a remote Magpie gateway instead of local OAuth credentials, create usage-float.json inside the corresponding Claude config directory (for example ~/.claude-2/usage-float.json):

{"source": "magpie", "provider": "claude", "account": "you@example.com"}

usage-float reuses ANTHROPIC_BASE_URL (HTTPS) and ANTHROPIC_AUTH_TOKEN / ANTHROPIC_API_KEY from settings.json in the same directory (or Paseo provider environment variables) to query /v1/magpie/quotas for that account's 5-hour and 7-day subscription windows and reset timestamps. No local OAuth token is required. If a query fails, usage-float never falls back to a different local subscription and marks the cached reading as stale. Magpie-backed accounts display usage only and do not expose local Claude rate-limit reset buttons.

Controls & Interactions

Action Effect
Click bottom-left refresh bar / F5 Refresh active providers now
Click a Codex usage percentage Open the banked rate-limit reset credit dialog for that Codex account
Click a claude 7d / claude 5h percentage Open the Claude weekly or 5-hour rate-limit reset dialog for that Claude account
Drag window Move the floating HUD
Right-click Refresh / Settings / Toggle auxiliary-screen panel / Always on top / Start at login / Exit
Shortcut (default: double-tap Ctrl) Toggle between Usage Dashboard and Live Wallpaper
Esc Exit
Home Reset floating HUD position to the primary display corner

Settings

Right-click -> Settings...

Use the Language selector at the top of Settings to switch between Simplified Chinese (zh, default) and English (en). The selection is saved immediately in ~/.usage-float/config.json (independent of the AgentCompass tray language) and live-refreshes Settings, the floating HUD, the auxiliary-screen dashboard, context menus, and rate-limit reset dialogs without restarting.

Usage Tab

  • Two-Column Drag-and-Drop Layout: Drag any provider row freely between the left and right columns to arrange the auxiliary-screen dashboard; unchecked rows remain visible and dimmed in place. The layout lists the rows of accounts this machine has, the same accounts the float shows. A machine with one Codex account and no Grok lists no Codex 2 or Grok row.
  • Absent Accounts Keep Their Place: While an account is signed out, its rows are not listed, and their column, position and on/off stay in the config. A hidden row stays after the row it followed and moves with that row. When the account is back, its rows return where they were. Rows of an account kind this program knows (any claude-* or codex-* home, Grok, Pi, OpenCode, Antigravity) are kept for as long as the config exists; there is no control to forget an account. Until the first scan of an open Settings window has answered, the saved rows show; an account that signs in while Settings is open appears with its next reading.
  • Scan Available Accounts: Discovers local Claude/Codex homes, Paseo provider directories, Magpie gateways, Grok, Antigravity, metered accounts and Pi. Rows of a new account join next to rows of the same kind and are switched on. Rows of an account that is gone leave the page at the scan and stay in the config. The float and the scan Settings starts by itself add only an account none of whose rows is saved; when another program or you saved some of an account's rows (for example only its 7d and 5h), only the scan button adds the rest, switched on.
  • Quick Toggle & Auto-Balance: Click the checkbox or double-click any row to toggle it on/off, or click Auto-Balance Columns to split enabled rows evenly across both columns.
  • Granular Provider Windows:
    • Each Claude account splits into independent fable 7d, claude 7d, and claude 5h rows (e.g., Claude 2 fable 7d, Claude 2 7d, Claude 2 5h).
    • Antigravity splits into four independent rows sharing a single CLI probe: agy gemini 7d, agy gemini 5h, agy claude 7d, and agy claude 5h (abbreviated to gem in compact floating mode).
  • Clean Failure Handling: Providers without local credentials take no space. When a refresh fails, an error label is shown only if no prior valid snapshot exists for that credential.
  • Metered USD: A dollar account shows what has already been spent. With a budget the row reads 已用 $2.65 / $200 (English: used $2.65 / $200). Without a budget it reads 已用 $12.30. There is no reset countdown.

Auxiliary Display Tab

  • Select a target monitor and enable Dedicated Auxiliary-Screen Mode. usage-float binds to the monitor's hardware identifier, automatically restoring full-screen panel layout when the display is hot-plugged and falling back to the floating HUD while disconnected.
  • Customize the wallpaper toggle shortcut (repeated key press 2–8 times, or key combination such as Ctrl+Alt).

Live Wallpaper Tab

  • Folder Management & Recursion Depth: Add media directories with configurable subdirectory recursion depth (0–8 levels) and per-folder random selection weights.
  • Background Indexing: Newly added folders take effect immediately while a background scanner builds and persists ~/.usage-float/wallpaper-index.json, so opening the weight dialog never re-scans the disk. Long paths automatically truncate middle segments while preserving the root and leaf folder names.
  • Supported Media: JPG, PNG, WebP, GIF, MP4, WebM, MKV, and MOV.
  • Playback Behavior:
    • Starts on a weighted random item. Videos under 30 minutes play from the beginning; longer videos jump to a random chapter (or a random timestamp if unchaptered).
    • Images display for 10 seconds by default (2–300 seconds configurable); portrait images center-crop to a square while landscape images and videos fill the panel.
    • When the panel is focused: Left / Right arrows seek ±5s in video mode or step to the previous/next image; the mouse wheel adjusts volume.
  • Instant Drag-and-Drop & Web Video Playback:
    • Drop a local video file onto the window to loop that file immediately.
    • Drag and drop an entire browser window, a torn-off browser tab, a web link, a video thumbnail card, a .url/.html file, or press Ctrl+V (or right-click → Paste Web/Video URL to Play) to launch an embedded borderless browser that full-screens and loops the web video (automatically closing the dragged source browser window after reading its URL), with Left/Right ±5s seeking, mouse-wheel volume, and mute controls.
    • Switching back to the Usage Dashboard terminates mpv or the embedded browser process immediately so zero background decoding remains.

Rate-Limit Reset Credits & Provider Mechanics

Codex Rate-Limit Reset Credits

Eligible ChatGPT Plus / Pro subscriptions receive banked rate-limit reset credits valid for 30 days. Clicking a Codex row's usage percentage opens the credit list strictly scoped to that account (CODEX_HOME):

  • List credits: GET https://chatgpt.com/backend-api/wham/rate-limit-reset-credits
  • Redeem credit: POST https://chatgpt.com/backend-api/wham/rate-limit-reset-credits/consume with a unique redeem_request_id for idempotent deduplication.

Claude Rate-Limit Resets

Weekly Reset (cedar_ember)

Anthropic grants eligible accounts /limit-reset entitlements (internal program cedar_ember). Clicking the claude 7d percentage opens a dialog showing grant expiration times and resettable windows.

Entitlement status piggybacks on the regular usage request with zero extra API calls:

GET https://api.anthropic.com/api/oauth/usage?cedar_ember=1&skip_spend=1

Because Anthropic only returns this block to the CLI surface (plain requests receive ineligible_reason: "surface"), usage-float sends anthropic-client-platform: cli and dynamically reads the installed @anthropic-ai/claude-code/package.json version for User-Agent: claude-cli/<version>.

Redeeming a reset sends the exact CLI payload:

POST https://api.anthropic.com/api/organizations/<organizationUuid>/reset_rate_limits
{"program": "cedar_ember", "grant_id": "<next_grant_id>", "request_id": "<uuid>"}
  • Only next_grant_id can be redeemed immediately; additional grants appear as queued.
  • organizationUuid is read from oauthAccount.organizationUuid in ~/.claude.json (falling back to /api/oauth/profile).
  • Network errors, 5xx, or 429 responses reuse the same request_id on retry so a grant is never double-spent.

5-Hour Session Wall Reset (juniper_tide)

Clicking claude 5h checks for the experimental weekly 5-hour session reset (juniper_tide), which becomes available only when an eligible account hits the 5-hour wall. Opening the dialog performs a read-only probe against GET https://api.anthropic.com/api/oauth/usage?at_wall=1&skip_spend=1 and redeems via:

POST https://api.anthropic.com/api/organizations/<organizationUuid>/reset_rate_limits
{"program": "juniper_tide"}

Antigravity Usage

Queries the official agy CLI's structured output:

agy -p /usage --output-format json

Runs inside an empty temporary directory using the CLI's own login state without reading or copying tokens, enforces a 60-second timeout and 1 MiB output cap, and on Windows holds the query to its one process: when agy cannot refresh its sign-in it would open a browser page by starting another program, which a background read is refused, so the reading is reported as failed instead. A failed read is run once more after 8 seconds (the token-refresh gap); a read that used its whole time is not. Requires agy 1.1.11+ so older CLI versions never mistake /usage for a model prompt.

Metered USD usage

Spend is read from the account in AgentCompass accounts-override.json, and only from GET {origin}/key/info. When that route returns a spend number, the row shows it (with the budget when one exists). A 401 or 403 shows no usage number; the hover says there is no permission to query usage. A network error, a timeout, or any other response stays an ordinary read failure and the hover names that reason. Nothing about the balance resets. Old llm_proxy_* settings no longer apply. The window still starts. The status line and the settings page say that old settings remain, including when no account row matches those keys. Saving settings once, or agentcompass setup, removes the keys.

Configuration & Caching Architecture

Settings are stored in ~/.usage-float/config.json:

Set "language": "en" for English or "language": "zh" for Simplified Chinese. Chinese remains the default for existing configurations that omit the field. Values are case-insensitive; zh-cn and en-us normalize to zh and en. Unsupported values fall back to zh.

{
  "language": "zh",
  "always_on_top": true,
  "providers": ["codex", "codex-2", "grok", "claude:fable", "claude:7d", "claude:5h", "antigravity:gemini-weekly", "antigravity:gemini-5h", "antigravity:3p-weekly", "antigravity:3p-5h"],
  "provider_order": ["codex", "codex-2", "grok", "claude:fable", "claude:7d", "claude:5h", "antigravity:gemini-weekly", "antigravity:gemini-5h", "antigravity:3p-weekly", "antigravity:3p-5h"],
  "disabled_providers": [],
  "refresh_seconds": 300,
  "display_mode": "panel",
  "shortcut_enabled": true,
  "shortcut_mode": "repeat",
  "shortcut_key": "ctrl",
  "shortcut_repeat_count": 2,
  "shortcut_combo": ["ctrl", "alt"],
  "wallpaper_folders": ["D:\\Wallpapers"],
  "wallpaper_image_seconds": 10,
  "wallpaper_audio": true
}
  • Layout Lists: provider_order, providers, disabled_providers and provider_columns hold the rows of every account seen, including accounts absent for now. Without a config, the rows of detected accounts appear in the shipped order. Saving settings removes a row that no kind of account can have. The row's id decides: an Antigravity window, Grok, Pi, OpenCode, a Claude home's fable/7d/5h, a Codex home's 7d/5h. Any other name is removed only when its registry (Paseo's config.json for a Claude or Codex home under its own name, accounts-override.json for a metered account) exists, can be read and does not list it; an old proxy row is removed that way. A missing or unreadable registry removes no row.
  • Float Layout: The float shows the checked rows of accounts this machine has. With every row unchecked it shows 暂无数据 and fetches nothing. A new account joins at the next refresh; if Settings saves the layout while that refresh is running, the saved layout stays and the account joins at the following refresh.
  • Minimum Refresh Interval: refresh_seconds has a 300-second floor.
  • Activity-Aware Cadence & 429 Backoff: Active accounts poll roughly every 5 minutes, idle accounts every 30 minutes, and accounts with unknown activity every 15 minutes. Failed probes respect the same cadence and per-credential 429 backoff; reopening the window never forces an upstream call.
  • Read-Only Credential Safety & Fingerprint Binding: Snapshots in ~/.usage-float/usage-cache.json are bound to a one-way SHA-256 fingerprint of their local credential and directory and written under a cross-process file lock (usage_lock.py) via atomic replacement. usage-float never rotates or writes CLI OAuth tokens; if a request fails with 401, it re-reads the disk credential at most once in case the CLI refreshed it, and never replays a rate-limit reset POST.

Development

python -m unittest discover -p "test_*.py"
.\build-release.ps1    # Builds dist\usage-float-<version>-windows-x64.zip

License

MIT License. mpv is distributed under the GPL: the source repository does not include the binary (Usage Float downloads the build pinned in mpv-pin.json on demand); release archives bundle mpv alongside THIRD_PARTY_NOTICES.md.

Related Projects

  • AgentCompass — task routing and quota scheduling across your AI subscriptions.
  • lark-mbti-jev — a local Feishu/Lark MBTI and anime persona overlay powered by Jev.

About

Borderless Windows HUD & CLI quota monitor for Claude Code, ChatGPT Codex, Grok, Google Antigravity (agy), Magpie & LiteLLM. Tracks multi-account 5h/7d rate-limit windows, redeems Claude/Codex limit-reset credits, and doubles as an mpv live wallpaper.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages