Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 19 Oct 15:22
· 27 commits to main since this release
Immutable release. Only release title and notes can be modified.

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, daemon and check. clanker-usage with no arguments shows every account in one table, and clanker-usage --json prints every account's document.
  • json prints a usage-v1 document, the same for every provider: provider, account, plan, status (live, cached, stale or unavailable), error, retrieved_at, windows (each with name, seconds, scope, used_pct and resets_at), balance for balance-billed accounts, and details for 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 SECONDS sets how old a cached document may be before a fresh fetch, defaulting to 0 for status and json and to 300 for statusline. It replaces --refresh (use --max-age 0). daemon --interval SECONDS replaces -i.
  • A fetch that fails shows the last document for the same account as stale; with nothing cached the result is unavailable and 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.
  • check fetches each provider live and compares the response's structure with recorded response shapes, reporting ok, new-shape, missing, error or expected-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 install subcommands, which printed setup instructions, are gone; the README covers setup.

agy-usage (Antigravity)

  • Windows are scoped to their model group, such as Gemini weekly and Claude 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 (check reports a disappeared window), and the AGY_ACCESS_TOKEN, ANTIGRAVITY_ACCESS_TOKEN, AGY_USAGE_FILE, ANTIGRAVITY_USAGE_FILE, AGY_CODE_ASSIST_BASE_URL and AGY_OAUTH_CLIENT_ID/_SECRET overrides.

ccusage (Claude Code)

  • daemon --defer is gone: config directories signed into the same account now share one cache, so their daemons stop duplicating requests on their own. Remove --defer from 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 DIR adds another config directory to clanker-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 statusline still 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.json and its schema_version 2 fields are replaced by the usage-v1 document. Codex's own limits are the 5-hour and weekly windows; additional limits are windows scoped to their names.
  • When Codex's app-server does not answer, the direct fallback now honors CODEX_HOME. refresh is 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.json first, then from the IDE's database.
  • Removed: CURSOR_USAGE_FILE, CURSOR_USAGE_STATE_DB and CURSOR_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 balance field.
  • DEEPSEEK_HARNESS_USAGE_API_KEY is now CLANKER_USAGE_DEEPSEEK_API_KEY, and DEEPSEEK_HARNESS_USAGE_FILE is removed. The cache moved from $DSH_HOME/usage-limits.json to 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_FILE and DEVIN_USAGE_CREDENTIALS_FILE; credentials follow XDG_DATA_HOME, as Devin does.

gemini-cli-usage (Gemini CLI)

  • With a login other than Google, such as an API key, the document is unavailable and check reports expected-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, weekly and monthly limits, 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 PATH once again. ZCODE_USAGE_ENV_FILE is removed.
  • used_pct is computed from the used and total credits, more exactly than the API's rounded percentage.
  • An account without a Coding Plan has a null plan and no windows, replacing "status": "no_plan".

History

First release of clanker-usage: https://github.com/wakamex/clanker-usage/commits/v0.4.0