Ship a built-in, zero-config terminal status line: billing account + 5h/7d rate limits + model
Preflight Checklist
- [x] I have searched existing requests and this specific ask hasn't been filed.
- [x] This is a single feature request.
Summary
Ship a default, zero-config status line in the terminal CLI that shows the three things almost every subscriber currently hand-rolls a statusLine script to get:
- Which account/org is billing this session (email + plan tag, e.g.
georg@…·Max,…·Team,…·Ent(OrgName)) - Rate-limit windows — 5-hour and 7-day used-% (
5h:100% 7d:27%) - The active model (
Opus 4.8)
i.e. render this out of the box:
☁ georg@example.com·Max | ~5h:100% 7d:27% | Opus 4.8
Today this only exists if you write and maintain your own ~/.claude/statusline.sh. That means every user who wants ambient billing/usage visibility re-implements the same script, and hits the same gaps and bugs doing it.
Why this is distinct from #74270
#74270 asks for usage/spend to be glanceable by default in general (and covers API $-spend, IDE, a keystroke, etc.). This request is the narrower, concrete CLI slice of that goal: a built-in terminal status-line preset with a specific, opinionated composition (billing identity + 5h/7d + model) that users can toggle on without authoring a script. Consider this a concrete implementation proposal that could be folded into #74270, or shipped as its own preset.
Why "billing identity" matters here specifically
Users running multiple accounts/orgs on one machine (token vs OAuth, personal vs corp) currently can't tell which identity a session bills to without a custom script — and even the custom script is unreliable because:
rate_limitscan show another concurrent session's numbers (#68772) and drifts across terminals (#75408).- The env token's identity isn't exposed, so scripts fall back to a hand-set
CLAUDE_ACCOUNT_LABEL.
A first-party preset would let Claude Code render the correct billing identity and correctly-scoped limits authoritatively, instead of every user reverse-engineering it.
Proposed shape
- A built-in
statusLinepreset (e.g.statusLine: { "type": "preset", "preset": "usage" }) or a/configtoggle, default off, that renders account · 5h/7d · model. - Optional bits: show remaining-% instead of used-%; per-model weekly windows once those land (#79022, #52661, #73770); reset-in-X.
Related
- #74270 — make usage/spend glanceable by default (parity with Codex) — parent/umbrella for this
- #33978 — built-in
claude usagecommand - #79994 — hide the weekly usage indicator (shows a native indicator already exists in the IDE extension, but not in the CLI)
- #68772 / #75408 — cross-account / cross-terminal rate-limit display bugs a first-party preset would sidestep
3 Comments
In the meantime, here is a userland reference implementation of exactly this preset (account · 5h/7d · model), in case it helps scope the built-in one. It renders:
What it does
~/.claude.json→oauthAccount(email + plan tag derived fromorganizationType/seatTier/userRateLimitTier), with provider-aware overrides:CLAUDE_CODE_USE_BEDROCK→bedrock·AWS(profile),CLAUDE_CODE_USE_VERTEX→vertex·GCP(project), key-only auth →api-key·API(host). If an OAuth login andANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKENare both present it renders…+key?instead of guessing which one bills.rate_limits.five_hour/seven_day). Since these only appear after the first API response, values are cached persession_idand merged per window; anything served from cache is prefixed with a dim~. Colour-coded green/amber/red at 50/80%.TERM/COLORTERM.CC_STATUSLINE_MODE=remaining), reset-in (CC_STATUSLINE_RESET=1), context-window segment, short email, tier tag, custom label, icon/colour toggles.--demo/--palettepreview modes that don't touch the cache.Install
Requires
jq; tested on macOS bash 3.2 and zsh.Why this still argues for a first-party preset — two of the gaps in the issue body are unfixable from userland, and this script only mitigates them:
rate_limitscan carry another concurrent session's numbers (#68772, #75408); a script can mark cached values~but cannot correct live ones.~/.claude.json— which reflects the logged-in account, not necessarily the identity an env token bills to (hence the+key?ambiguity marker).<details>
<summary><code>~/.claude/statusline.sh</code> (click to expand)</summary>
</details>
Correction to the reference implementation above, plus the finding behind it:
CLAUDE_CONFIG_DIRscopes the identity but not the numbers, and that is only half fixable in userland.1. Bug in the snippet above
The cache is per profile, but the identity is not: run
CLAUDE_CONFIG_DIR=~/.claude-alt claudeand the status line renders the default profile's account while the session bills the alt profile. Also[ "$ACCOUNT_CACHE" -nt "$CLAUDE_JSON" ]then invalidates against the wrong file. Fix:Note the asymmetry that makes this easy to get wrong, and which is arguably a papercut of its own: the default profile keeps its config at
~/.claude.json(not~/.claude/.claude.json), a custom profile at$CLAUDE_CONFIG_DIR/.claude.json.2. Generalisation: everything account-scoped must be keyed by the profile
Not just the identity lookup — every cache path and every account-scoped URL. In a variant of this script I had an account-scoped cache at a fixed
~/.claude/cache/...path with a 300 s TTL, shared by three profiles. Net effect: profile B's monthly spend figure rendered inside profile A's session — a correct account label sitting next to another account's money, with nothing on the line to suggest a mismatch. Same for any URL carryingorganizationUuid/accountUuid: read them from the current profile's ownoauthAccount, never hardcode.3. The half that userland cannot fix
With 1 and 2 fixed the label is right per profile, but the figures still are not. On macOS the only credential store is a single Keychain item,
Claude Code-credentials:CLAUDE_CONFIG_DIR;.credentials.jsonappears inside a customCLAUDE_CONFIG_DIR;oauthAccountin its own.claude.json.So any script that authenticates to
/api/oauth/usageto get richer limits than the stdin payload offers gets whichever account that one shared item currently holds. Observed on a three-profile machine (three different plans: Team, Enterprise, Max): after fixing 1 and 2, all three profiles rendered byte-identical 7-day and model-scoped percentages. The label followsCLAUDE_CONFIG_DIR, the numbers follow the Keychain, and the two disagree silently. Same class of failure as #77993 (2) and #68772.Ask
Two things for the built-in status line, both of which remove the need for the workarounds above:
CLAUDE_CONFIG_DIR..claude.jsonor the Keychain to find out who is paying.Similar ask — while waiting on a built-in version: usage is a free menu-bar/tray app that shows 5h/weekly limits + billing account with zero config, reading local logs (no API calls).