quota-reporter
Installation
SKILL.md
Quota Guard
This skill installs and runs the local quota guard for Codex and Claude.
What it does
- Tracks the current local auth state per source in
~/.agents/auth/known_auth.json - Uploads the current auth for each source to the shared encrypted auth pool only when the auth changed
- Probes the current local Codex quota and the current local Claude quota to decide whether the current machine should rotate
- When local quota is low, asks the cloud auth pool for a strictly better auth from the same source and installs it locally
- Installs a reboot-safe scheduler that runs every 15 minutes
- Stores the user's personal company-email auth-pool token locally so future runs can upload and fetch without prompting again
Files
- Combined local guard:
scripts/quota_guard.py - Installer:
scripts/install_quota_guard.py - Claude statusline hook:
scripts/claude_statusline_probe.py - Internal shared helper library:
scripts/quota_reporters.py - Remote worker trigger/watch:
scripts/trigger_remote_probe.py - Archived legacy scripts:
archive/ - Skill overview:
README.md
Required inputs
You need:
- the shared auth-pool URL, for example
https://quota-report-hub.vercel.app - a personal auth-pool user token issued by company email
That same personal token is also used to unlock the hosted dashboard.
Standard flow
Install the 15-minute guard
Run:
python3 scripts/install_quota_guard.py \
--auth-pool-url https://your-dashboard.vercel.app \
--email your.name@stardust.ai
The installer:
- asks for a company email if one was not provided
- requests an emailed personal token from
/api/auth/issue-token - asks the user to paste the token back into the terminal
- writes the local config file under
~/.agents/auth/quota-reporter.json - installs the 15-minute scheduler
- writes Claude Code
statusLinesettings to~/.claude/settings.json
Token rules:
- only the latest token for an email remains valid
- requesting a new token revokes the old one
- the latest token can still be reused on multiple machines
If the user is not already using a compatible hub, the correct order is:
- either deploy a new hub with
scripts/deploy_vercel.pyor confirm an existing hub already supports the auth-pool APIs - then run
install_quota_guard.py - then paste the emailed token
- then let the scheduled guard handle the rest
Run one manual guard cycle
python3 scripts/quota_guard.py
Trigger one remote cloud probe
python3 scripts/trigger_remote_probe.py
This script:
- triggers the GitHub Actions workflow
probe-auth-pool.yml - waits for the newly created
workflow_dispatchrun onmain - prints the run id as JSON
- watches the run until it finishes
- then fetches the hub status and returns a compact result row for each auth
If you only want the run id and do not want to attach to the live log:
python3 scripts/trigger_remote_probe.py --no-watch
The guard then:
- updates
~/.agents/auth/known_auth.json - uploads the current auth to the auth pool only when needed
- probes the current live Codex auth and Claude auth
- if a local source is below
20%in5Hor below5%in1week, calls/api/auth/fetch-bestwithsource + current local account + current local quota - only accepts a server response when it contains a strictly better replacement from that same source
- only replaces local source credentials when the fetched auth is different from what is already installed
- shows a desktop notification after a successful local replacement so the user knows to quit the current Codex or Claude Code session and start a new one
- does nothing when the cloud cannot provide a better auth than the current one
- relies on the cloud auth pool to deduplicate repeated uploads for the same
account_id, even when raw files differ - if the same account is refreshed locally, the changed
auth_last_refreshis enough to trigger a new upload
Operational notes:
- replacing
~/.codex/auth.jsondoes not hot-switch already running Codex sessions - the next new Codex session is the one that should pick up the new auth
- the local config file contains a personal token and should stay private
- the cloud dashboard shows the latest cloud-worker probe for each auth entry
- Codex rows are refreshed by the cloud worker
- Claude rows are refreshed by the cloud worker only when the local machine is using a direct Claude subscription. If
~/.claude/settings.jsoninjectsANTHROPIC_*provider credentials, the skill skips Claude cloud uploads for that machine.
Output expectations
- After installation, show the scheduler type, config path, and Claude statusline settings path.
- After a manual guard run, show the current Codex and Claude probe payloads plus whether a replacement happened for each source.
- If token request, auth upload, or best-auth fetch fails, include the HTTP status and response body.