Repository navigation
v0.4.0
clanker-usage is the first release of one codebase for nine coding-agent usage monitors. It shows the plan and quota of Claude Code, Codex, Antigravity, Gemini CLI, Cursor, Devin, DeepSeek, OpenCode Go and Z.ai accounts, with the same commands, the same JSON document and the same file layout for every provider. The eight existing packages, agy-usage, ccusage, codex-cli-usage, cursor-cli-usage, deepseek-harness-usage, devin-cli-usage, gemini-cli-usage and zcode-cli-usage, are now built from it at version 0.4.0, and opencode-cli-usage is new. Each keeps its name and command, but its options, JSON output and cache location change to the shared standard, so scripts and status lines that read the old output need updating, as described below.
What every package now does
- The same subcommands for every provider:
status(the default),json,statusline,refresh,daemonandcheck.clanker-usagewith no arguments shows every account in one table, andclanker-usage --jsonprints every account's document. jsonprints a usage-v1 document, the same for every provider:provider,account,plan,status(live,cached,staleorunavailable),error,retrieved_at,windows(each withname,seconds,scope,used_pctandresets_at),balancefor balance-billed accounts, anddetailsfor provider-only data. The README describes every field.- The cache is that same document, at
~/.cache/clanker-usage/PROVIDER/ACCOUNT.json, one file per account. Configuration is~/.config/clanker-usage/config.json. The old per-tool cache files are no longer written. --max-age SECONDSsets how old a cached document may be before a fresh fetch, defaulting to 0 forstatusandjsonand to 300 forstatusline. It replaces--refresh(use--max-age 0).daemon --interval SECONDSreplaces-i.- A fetch that fails shows the last document for the same account as
stale; with nothing cached the result isunavailableand the command exits with status 1. After a failure, status lines stop retrying for a minute, doubling up to 30 minutes, so an outage does not mean a request on every prompt. - A daemon skips a refresh another process made within its interval, so several daemons or status lines on one account do not multiply requests.
checkfetches each provider live and compares the response's structure with recorded response shapes, reportingok,new-shape,missing,errororexpected-unavailable, so a provider changing its API is noticed instead of silently breaking.- Requests never follow redirects, error messages never contain response bodies or credentials, and caches are private files replaced atomically.
- The
installsubcommands, which printed setup instructions, are gone; the README covers setup.
agy-usage (Antigravity)
- Windows are scoped to their model group, such as
Gemini weeklyandClaude and GPT 5-hour. - The cache no longer holds the summary of
history.jsonl, which included the most-typed prompts. clanker-analytics reports Antigravity's token use from its transcripts instead. - Removed:
--root, which only labelled the output,missing_groups(checkreports a disappeared window), and theAGY_ACCESS_TOKEN,ANTIGRAVITY_ACCESS_TOKEN,AGY_USAGE_FILE,ANTIGRAVITY_USAGE_FILE,AGY_CODE_ASSIST_BASE_URLandAGY_OAUTH_CLIENT_ID/_SECREToverrides.
ccusage (Claude Code)
daemon --deferis gone: config directories signed into the same account now share one cache, so their daemons stop duplicating requests on their own. Remove--deferfrom service files.- The per-account snapshots in
~/.claude/usage-limits/are replaced by the per-account caches, which likewise stay after logout. Documents carry no email. ccusage configure --config-dir DIRadds another config directory toclanker-usage's all-accounts table.- An account without a subscription is
unavailable, which replaces its old windows in the cache, as the old tombstone did. ccusage statuslinestill reads Claude Code's status JSON and now shows the directory, model and session cost before the quota.
codex-cli-usage (Codex)
~/.codex/usage-limits.jsonand itsschema_version2 fields are replaced by the usage-v1 document. Codex's own limits are the5-hourandweeklywindows; additional limits are windows scoped to their names.- When Codex's app-server does not answer, the direct fallback now honors
CODEX_HOME.refreshis new.
cursor-cli-usage (Cursor)
- The plan name, such as Pro, is now reported, and the reset is an ISO time rather than raw milliseconds.
- The token comes from the Cursor CLI's
~/.config/cursor/auth.jsonfirst, then from the IDE's database. - Removed:
CURSOR_USAGE_FILE,CURSOR_USAGE_STATE_DBandCURSOR_USAGE_AGENT.
deepseek-harness-usage (DeepSeek)
- A negative balance, which DeepSeek reports once usage outruns the balance, is now accepted; it failed before with "invalid total_balance". Balances are in the document's
balancefield. DEEPSEEK_HARNESS_USAGE_API_KEYis nowCLANKER_USAGE_DEEPSEEK_API_KEY, andDEEPSEEK_HARNESS_USAGE_FILEis removed. The cache moved from$DSH_HOME/usage-limits.jsonto the standard location, without its lock.
devin-cli-usage (Devin)
- The cache keeps only the plan and quota parts of Devin's response, without the account's name, email or model lists.
- Removed:
DEVIN_USAGE_FILEandDEVIN_USAGE_CREDENTIALS_FILE; credentials followXDG_DATA_HOME, as Devin does.
gemini-cli-usage (Gemini CLI)
- With a login other than Google, such as an API key, the document is
unavailableandcheckreportsexpected-unavailable, which does not fail it. - Token renewal finds Gemini CLI's OAuth client in the bundle that current releases ship.
- Removed:
--root(settings now come from the current directory, as in Gemini CLI),GEMINI_CLI_USAGE_FILE,GEMINI_OAUTH_CLIENT_ID/_SECRET, and the search of WSL distributions on Windows.
opencode-cli-usage (OpenCode Go)
- New. Reads the Go key OpenCode stores and reports the subscription's
5-hour,weeklyandmonthlylimits, which are dollar amounts. The source is the OpenCode Console's own Go status, which its documented API does not cover.
zcode-cli-usage (Z.ai)
- The env-file setting moved to the shared configuration file; run
zcode-cli-usage configure --env-file PATHonce again.ZCODE_USAGE_ENV_FILEis removed. used_pctis computed from the used and total credits, more exactly than the API's rounded percentage.- An account without a Coding Plan has a null
planand no windows, replacing"status": "no_plan".
History
First release of clanker-usage: https://github.com/wakamex/clanker-usage/commits/v0.4.0