Skip to content
المشاريع

حول

A privacy-first macOS menu bar app for tracking AI coding quotas, reset times, token usage, and costs across 21+ tools.

الأمان والخصوصية

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
٠
خلال 15 يومًا
٠
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

TokenRemain mascot animation: remaining quota draining from 100% to 0%, expression changing along the way

TokenRemain

Your AI coding quota, always in the Mac menu bar.
Credentials never leave your machine: read-only, never refreshed, never uploaded.

Latest release macOS 14+ · Universal Notarized by Apple Apache-2.0 license

⬇️ Download TokenRemain.dmg

Website · iPhone beta · Changelog · Privacy · Issues · 简体中文


Dashboard Overview: what runs out first, today's tokens and estimated cost, every official quota window with plan badges, today's usage and trending AI posts Menu bar panel: remaining quota per app with full window lengths, today's local usage and the AI Feed

Remaining quota, reset countdowns and today's cost for Claude Code, Codex, Cursor, Grok, GLM and 27+ tools — on one screen. (Real usage data.)

[!TIP] New in 1.5.1: a redesigned Dashboard and menu bar panel. Overview puts what runs out first, today's tokens and cost, every quota window and trending AI posts on one page; quota rows read simply "5 hours" or "Fable · 7 days", with the data source moved to the Dashboard's small print; plan badges follow your Subscriptions card; the Daily Usage Trend gets an Apps menu to add or remove apps. Numbers and bars roll in on first open, buttons answer with springs and ripples, and the panel and Dashboard fade in and out — all of it follows Reduce Motion. See the changelog for earlier releases.

Features

🧭 Quota — know whether you'll make it to reset

  • 27+ tools side by side: every official quota window with a progress bar, reset countdown and freshness; Overview lists them in one table, most urgent first.
  • Pace prediction: real window progress decides whether your current pace lasts until reset, with an ETA when it won't.
  • Clean rows: each bar names only its pool and window length ("5 hours", "Fable · 7 days"). Where the numbers come from (for example Claude Web) appears once, in the Dashboard's small print.
  • Multiple accounts: each account of the same tool gets its own rows; when an app has several, the non-default ones are named in small print above their rows. The Account Management page toggles monitoring per app, enables or pauses accounts, renames them and updates credentials.
  • Wherever you look: menu bar capsules, a floating window across Spaces, two meters on the Dock icon (you pick the apps), and a Liquid Glass panel on macOS 26 whose height follows the cards you expand. Reorder the panel's cards however you like.

📊 Usage — where the tokens go, and what you pay

  • Today's cost: the bundled ccusage counts 15+ local coding agents offline (Claude Desktop / Cowork included), estimated at official API list prices.
  • Choose what Trends shows: the Daily Usage Trend's Apps menu adds or removes apps. Apps whose local logs TokenRemain reads stay selectable even with nothing recent; apps with quota data only are listed so it's clear why they can't be charted.
  • Token mix and output speed: input, output, cache write and cache read counted separately; click any day for a per-model breakdown with end-to-end tok/s estimated from local Claude Code and Codex logs.
  • Subscriptions: monthly plan prices with per-account overrides, employer-paid exclusions and usage-based tier suggestions; plan badges on Overview and Limits follow what you set here.
  • Display currency: USD, CNY, EUR, JPY and 9 more; only list-price estimates are converted, official bills and balances stay in their billing currency.

🔐 Privacy — credentials never leave your Mac

  • Reads what's already there: no account to create, no telemetry, never refreshes third-party tokens, never uploads credentials.
  • Optional encrypted sync: off by default; when on, only an allowlisted snapshot is encrypted into your own iCloud for iPhone, Apple Watch and Home Screen widgets.
  • AI Feed and Trending: curated posts from Anthropic, OpenAI and other official accounts in a single readable column, the top picks shown on Overview, with local alerts for quota resets and major updates.
  • Light on energy: background CPU down 95% vs v1.2.2 (method), and 1.5 trims background wake-ups and memory further; interface in English, 简体中文, 繁體中文, 日本語, 한국어 and more.

Screenshots

Limits page: official windows per provider with reset countdowns, pace reserve and the data source in small print Trends page: stacked daily token bars with the Apps menu, token mix and quota-consumption curves
Limits · remaining quota, reset time and pace reserve for every window, flagged red with a run-out ETA when you're ahead of budget. Trends · daily tokens or cost stacked by app (pick them in the Apps menu), the token mix, and how fast each quota window is being used.
More screenshots: iPhone, Apple Watch and widgets

iPhone overview page, aggregating up to 16 Macs iPhone trends page iPhone AI Feed page Apple Watch overview

Small iPhone Home Screen widget Medium iPhone Home Screen widget

The iPhone app is in public TestFlight beta. Data is published one-way and encrypted by the Mac; the mobile client source is outside this repository's open-source scope.

Quick start

  1. Install: download the DMG, drag TokenRemain into Applications and open it.
  2. Pick your tools: the welcome screen scans your Mac for installed AI tools — tick the ones to track. TokenRemain reuses each tool's own sign-in, so there's nothing to log into; Codex can reuse the official desktop app's sign-in.
  3. Add keys if needed: for services that need an API key (Z.ai, OpenRouter, …), paste it straight into that service's quota card, or under "API key settings" on the Data Sources page. Keys stay in your Mac's Keychain.
  4. Tune it: set the quota refresh interval (1–30 minutes or manual) in Settings › Refresh & Sync; choose the Dock icon's two apps and the display currency in Settings › General; enter what you pay on Overview › Subscriptions; pick the apps in Trends with the Apps menu.

[!NOTE] Local token stats for Claude Code / Cowork need no extra CLI. Claude quota needs a readable Claude Code sign-in, or a claude.ai session configured on the Data Sources page (see the FAQ); signing in to the Claude desktop app alone doesn't guarantee the Code credential stays renewed.

Supported services

🟢 Auto = connected as soon as the tool is signed in · 🔑 API key = paste once, stored only in the macOS Keychain

Service Connect What it reads
Claude Code 🟢 5-hour / 7-day windows; third-party ANTHROPIC_BASE_URL attributed to its real API
Codex 🟢 5-hour / 7-day windows and reset cards; custom base_url attributed to its real API
Cursor 🟢 Monthly billing-cycle quota, with Cursor and other models as separate pools
Grok (xAI) 🟢 Weekly pool remaining
Grok Bot 🟢 Weekly allowance, read through the local Cursor sign-in (use the same Cursor account as Grok Bot)
GitHub Copilot 🟢 Monthly credits
Devin 🟢 Daily / weekly quotas
Windsurf 🟢 Daily / weekly quotas
Antigravity 🟢 Quota pools
OpenCode 🟢 Local plan estimate; third-party providers attributed to their real API
Z.ai / BigModel 🔑 Coding Plan quotas; prepaid CNY API balance on macOS (China → API Balance)
OpenRouter 🔑 Key limits, credits and account balance
16 more extended providers and local cost sources
Service Connection Service Connection
DeepSeek API key Qoder Cookie
Kimi API key / cookie Kiro kiro-cli /usage parsing
MiniMax API key Volcengine AK:SK signing
MiMo Code Cookie Ollama Session cookie
GLM Team API key + org + project Alibaba Token Plan Console cookie
Amp Amp CLI key (read automatically) or cookie Muse Cookie (muse.ai)
Muse Code Cookie (dev.meta.ai), read per team Factory Cookie (app.factory.ai)
Augment Cookie (app.augmentcode.com) Third-party APIs New API / custom balance endpoint

How cookie-based services connect: sign in to the service's website, copy the request's Cookie value from your browser's developer tools (or right-click the request → Copy as cURL), then paste it into that service's quota card or use Paste from Clipboard in its setup guide (or provide it via QODER_COOKIE, MIMO_COOKIE, OLLAMA_COOKIE, MUSE_COOKIE, MUSE_CODE_COOKIE, AMP_COOKIE, FACTORY_COOKIE or AUGMENT_COOKIE). Cookies are stored only in your Mac's Keychain, like API keys; TokenRemain never reads your browser's own cookie store. A cookie is a sign-in credential — never share it; signing out of the website invalidates it, so paste a fresh one afterwards.

Local cost sources: the bundled ccusage collector discovers 15+ local agents (Claude Code, Codex, Gemini, Antigravity, Goose, …) and merges ~/.claude, ~/.config/claude, CLAUDE_CONFIG_DIR and Claude Cowork session folders (deduplicated; add custom folders on the Data Sources page). Trae contributes only timestamps, model names and token counts from a folder you select. Hosted models use official list-price estimates; local models like Ollama stay at zero cost, and tokens are kept even when a price is unknown.

Privacy

Credentials already on your machine ──read-only──▶ Official provider APIs ──▶ Rendered & cached locally

Every claim links to the code or test that backs it:

  • Read-only credentials, never refreshed — Reads the tokens your tools already maintain, never writes back, never competes for refresh tokens; background reads disable Keychain UI, so no system prompt appears. 🔍 contract script · tests · source
  • Pasted keys stay in the local Keychain — API keys go into the macOS Keychain and are barred from syncing to iCloud Keychain. 🔍 source · tests
  • No account, no telemetry, no credential relay — Quota queries go straight to each provider's official API; the only dependencies are Sparkle and this repo's sync package, with no analytics SDK. 🔍 dependencies
  • Price and rate updates carry no local data — The price table is fetched by at most one GET per day with no body, query string or auth header; only when you pick a currency other than USD does an equally fixed request fetch public reference rates. 🔍 pricing tests · contract script · rates source
  • Sync is off by default and end-to-end encrypted — When enabled, only an allowlisted display snapshot is AES-GCM encrypted on your Mac, then written to your own private iCloud database. 🔍 off-by-default test · field allowlist · encryption

Other network activity (never carries credentials or usage): AI Feed fetches public posts from api.tokenremain.com; notifications are off by default and register a random install ID only when enabled. Service status reads the public endpoints of status.openai.com and status.claude.com. A non-USD display currency reads public reference rates from open.er-api.com. Update checks read a signed appcast on GitHub. Direct LAN sync listens on TCP 47831 and accepts only paired devices.

Details in the privacy policy.

FAQ

A card says "Login not detected"

TokenRemain never refreshes tokens; it only reads the sign-in state each tool saves. Sign in again in that tool and use it once, and the data comes back automatically. Some tools, such as Antigravity, need to be opened and used once before their credentials are written to disk.

Why are only some apps in the Daily Usage Trend?

The chart draws per-day tokens from local logs, so only apps that write them can appear. Tools whose logs the bundled ccusage reads (Claude Code, Codex, Gemini CLI, Antigravity, OpenCode and more) can be added from the Apps menu even with nothing recent — their bars appear as soon as they log something. Apps TokenRemain only has quota data for, such as Cursor and Grok Bot, are listed under "Quota data only": they keep no local token logs to chart, but their quota still shows everywhere else.

How do I see Claude quota without the Claude Code CLI?

Paste your own claude.ai sessionKey or Cookie into the Claude row on the Data Sources page. Once verified it's stored only in your Mac's Keychain and excluded from iCloud Keychain sync; TokenRemain never imports browser cookies or refreshes third-party credentials. The default Claude quota then comes explicitly from that web account, while separate CLI accounts keep their own credentials; removing the cookie returns to local OAuth. If several organizations can't be matched uniquely, enter the target organization UUID.

The web endpoint isn't a public API: an access challenge, an expired session or a network failure can make it temporarily unreadable, in which case the card keeps the last quota with its original timestamp.

Claude shows "usage read timed out" or "Claude is unreachable"

The card is showing the last good cached snapshot; TokenRemain retries once the network is back and never asks you to sign in over a network failure. The official API follows the system proxy. When an expired credential has to be renewed through the Claude Code CLI, TokenRemain tries, in order: the app's environment variables, the env block of Claude Code's settings.json, the system proxy (including PAC) and proxy variables exported by your login shell — and uses the first one that reaches api.anthropic.com. If it still doesn't recover, run claude in a terminal and execute /usage once.

Is Claude Desktop / Cowork usage counted?

Yes. Local stats merge ~/.claude, ~/.config/claude, an inherited CLAUDE_CONFIG_DIR and Claude Cowork's .claude/projects folders, read offline and deduplicated by the bundled ccusage. The Data Sources page lists the folders it found and lets you add a custom config folder that contains projects. Plain chats, web and phone sessions leave no local token logs, so they aren't counted.

The top alert and the card show different percentages

The alert reflects the tightest of all windows (usually the 7-day one), while the card's first row shows the shortest window — they're not the same window.

Today's cost doesn't match my bill

Cost is an estimate of local token usage at official API list prices. It shows the scale of your usage, not your subscription bill — enter what you actually pay on Overview › Subscriptions. Switching the display currency converts only these estimates; official billed amounts and balances always stay in their billing currency.

How is tok/s calculated?

After each local usage refresh, TokenRemain reads only the newly appended part of Claude Code and Codex session logs, extracts timestamps, model names and token counters, and estimates each model's end-to-end output speed (time to first token included). The scan runs at low priority with time and size limits, and the results stay on your Mac.

A card is labeled "third-party API"

When Claude Code has ANTHROPIC_BASE_URL set, or Codex has a custom base_url, the quota comes from the API actually serving you, and the card names it. If you use the official sign-in and still see this label, please open an issue with your redacted configuration.

How do I uninstall completely?

Quit TokenRemain and delete the app, then remove local preferences and caches:

defaults delete com.jamesli.usagedock
rm -rf ~/Library/Caches/com.jamesli.usagedock ~/Library/Application\ Support/com.jamesli.usagedock

Pasted keys can be removed in Keychain Access by searching for com.jamesli.usagedock. If you enabled sync and want the iCloud data cleared, contact support.

Still stuck? Open an issue or visit the support page.

Contributing

Issues and pull requests are welcome. Build steps, tests, repository layout and conventions are in CONTRIBUTING.md; please report security issues privately as described in SECURITY.md, not in a public issue.

Downloads over time

Cumulative website download chart, rendered from daily snapshots of the anonymous aggregate counter

Starts from 163 historical downloads as of 2026-08-07 (breakdown), then grows through the anonymous download link and an hourly reconciliation with GitHub's DMG download total; no personal data involved.

Acknowledgments

  • token-monitor (MIT) — the extended providers' quota readers are ported from this project, which also inspired the floating window and preferences.
  • ccusage (MIT) — bundled with the app to count local agents' token usage.
  • OpenUsage (MIT) — reference for the direct Claude quota API provider design.
  • LiteLLM — the public model price table.
  • ExchangeRate-API — public reference rates for display currencies.
  • Sparkle (MIT) — signed app updates.

Third-party copyright and license notices are in NOTICE.

License

Source code and source documentation are available under the Apache License 2.0; the TokenRemain name, logos, icons, robot character and original design assets are not included — see the brand and asset licensing terms.

TokenRemain is an independent app, not affiliated with, endorsed by, or sponsored by Anthropic, OpenAI, Anysphere, xAI, GitHub, Zhipu AI, or any other provider; service names and marks appear only to identify the services you can choose to connect. Publisher and support contact: Dongheng Li · [email protected] · © 2026

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…