Claude Code UsageThe Claude Code coach in your status bar. Not a billing tool. Not a multi-provider monitor. A focused token tracker that uses AI to help you use Claude Code better.
🌐 Multi-language documentation: English · 繁體中文 · 简体中文 · 日本語 · 한국어 ScreenshotsStatus bar
Today's cost · current-session cost · 5-hour and weekly quota utilisation. Hover the quota indicator for a breakdown:
Real Dashboard
Click the status bar to open the full dashboard. Stacked token-composition chart, hourly breakdown, cache hit rate, cost composition by token type, plus per-model and per-day tables below. Content tab — where your tokens actually go
Estimated breakdown of which content consumes tokens — your prompts vs.
tool results (by tool) vs. assistant output / thinking. This is the lever
for optimising your usage. Scoped to the last 30 days
( AI advice — a coaching report from your real usageAI advice writes you a Markdown document, so it reads better as text than as
a screenshot. Set a key ( A flavour of what it returns (illustrative):
Usage Optimizer
Paste a rough, half-formed request; get back one clean, paste-ready prompt (plain text, no Markdown) plus a recommended reasoning effort / thinking / model shown as chips. Three optional toggles refine it (flag vague references · condense long pastes · suggest a style direction). Experimental, off by default; only the text you paste is sent — never your files or the terminal — behind a one-time consent prompt. What's new in 2.1
What's new in 2.0
Full changelog: CHANGELOG.md. Closes upstream issues #7, #10, #11, #13. InstallVS Code MarketplaceSearch for
Cursor / Windsurf / Antigravity (Open VSX)Same extension is published at the Open VSX Registry: GrowthJack.claude-code-usage. From a
|
| Setting | Default | What it does |
|---|---|---|
language |
"auto" |
UI language: auto / en / zh-TW / zh-CN / ja / ko. |
dataDirectory |
"" |
Custom Claude data dir; empty = auto-detect. |
advice.apiKey |
"" |
API key for AI advice + the Usage Optimizer (empty = advice opens a demo instead). |
Everything else — refresh interval, status-bar items, number/date formatting,
project grouping, content analysis, and all the AI advice / Optimizer options —
is in the dashboard's ⚙ Settings tab. Upgrading keeps your existing values: a
one-time migration copies them out of settings.json on first launch.
How costs are calculated
The status-bar cost is Σ (tokens × per-million rate) across input,
output, cache-write and cache-read, summed by model.
- Per-million rates come from the bundled pricing table, which is verified against the public Anthropic pricing page and supplemented with reference rates for non-Anthropic models that may appear in proxied setups.
Refresh Model Pricing(command + button in the dashboard) pulls live prices from LiteLLM's public dataset as runtime overrides.- Unknown model snapshots are priced against the current tier of their detected family (Opus / Sonnet / Haiku / GPT / Gemini / DeepSeek / Kimi / GLM / Qwen) instead of falling back blindly.
What the status bar does not know:
- Your actual Anthropic invoice (discounts, free credits, plan caps).
- Whether your proxy provider charges different rates.
- Anything not recorded in your local
.jsonllog files.
The 5h / weekly quota indicator is different — it queries Claude
Code's real /usage endpoint via the OAuth session and shows the actual
percentage Anthropic is tracking for your account. That number is
authoritative.
Privacy
- All token / cost / session analysis runs locally by reading your
~/.claude/projects/**/*.jsonlfiles. - The quota indicator calls
api.anthropic.com/api/oauth/usageusing Claude Code's existing OAuth token. No additional credentials are sent. - AI advice and the Usage Optimizer are the only features that call a
model — and only when you trigger them. AI advice sends an aggregate
summary of your usage plus a sample of your recent prompts; the Optimizer
sends only the text you paste into it (never your files or the terminal),
behind a one-time consent prompt. Both send to the endpoint in
advice.apiUrlwith your ownadvice.apiKey(Anthropic/v1/messagesby default, or any OpenAI-compatible endpoint). Bring your own key; nothing is shipped with the extension.
Troubleshooting
"No Claude Code Data"
- Make sure Claude Code is installed and you have used it at least once.
- Check the
dataDirectorysetting; auto-detection looks at~/.claude/projectsand~/.config/claude/projects.
Quota row shows 5h:--% wk:--%
- Claude Code's OAuth token is missing or expired. Log in to Claude Code
once; the extension reads
~/.claude/.credentials.jsonwhere present, or the macOS Keychain entry used by Claude Code, and refreshes the bearer if needed.
Get AI Usage Advice returns 404
- DeepSeek's current endpoint does not use a
/v1prefix. Usehttps://api.deepseek.com/chat/completions. The extension auto-strips/v1if present.
Get AI Usage Advice shows demo instead of real advice
- AI advice needs a key. With no key under
claudeCodeUsage.advice.apiKey, the command opens a hand-written demo (filename-marked…-DEMO-…, with a prominent banner) instead of calling any API. Add a key in Settings to get real advice.
Sluggish refresh on large histories
- 2.0 yields to the event loop every 25 files; idle ticks skip recompute.
If you still hit issues, raise
refreshIntervalor setenableContentAnalysistofalse.
Usage history disappears or is missing older months
- Claude Code automatically deletes conversation logs older than
cleanupPeriodDays(default: 30 days). Once deleted, those records cannot be recovered. To retain more history, add this to your~/.claude/settings.json:
This only affects logs kept from now on; already-deleted logs cannot be restored. Thanks to @nickearnshaw for documenting this ([PR #21](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/21)).{ "cleanupPeriodDays": 365 }
Token counts appear lower than the model provider's own dashboard
- If you use Claude Code with a third-party proxy that routes requests
through sub-agents or background workflows (e.g. ultracode / dynamic
workflows), each agent writes its own
.jsonllog file inside a sub-directory. The extension reads all these files, but some proxy configurations may not write agent-level records at all. Until native workflow attribution is added in a future release, the total shown here may be lower than the provider's upstream count. Your actual spend is always on your provider's billing page.
Credits
Maintained by @Carl723000, who forked it
from @jack21's original
ClaudeCodeUsage and now also helps own and
maintain the upstream organization
ClaudeCodeUsage/ClaudeCodeUsage.
MIT-licensed. The 2.x work documented here (everything under "What's new") is by
@Carl723000 with Claude Code; it has grown well
beyond the 2.0 baseline — see CHANGELOG.md.
Contributors whose upstream PRs / issues are incorporated here:
- @Dobidop —
[PR #9](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/9), the OAuth
approach for reading real
/usagedata; the quota indicator is adapted from that work. - @nickearnshaw —
[PR #8](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/8) locale-aware
number/date formatting;
[PR #20](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/20) fix for
the webview/status-bar getting stuck on "Loading…" (re-entrancy guard +
spinner only on cold start);
[PR #21](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/21) docs on
cleanupPeriodDaysfor retaining usage history; [PR #24](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/24) quota-window rollover handling (drop a window once its reset has passed). - @ScherbakovAl —
[PR #31](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/31), the
original status-bar context-window indicator and the
showCosttoggle. - @wheelbarrel00 —
[PR #38](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/38), the opt-in
weekly Opus limit (
showOpusWeekly) in the status bar. - @brenoneill — [PR #14](https://github.com/ClaudeCodeUsage/ClaudeCodeUsage/pull/14), custom data directory (merged into upstream 1.0.8).
- @mxzinke — Opus 4.5 / Haiku 4.5 prices
- German translation (upstream 1.0.8).
Also closed along the way: the test-suite seed (#25) and unreliable context-window detection for proxied/custom models (#31).
Many code changes in this fork were drafted with assistance from
Claude Code (commits include
Co-Authored-By: Claude <noreply@anthropic.com>).
Changelog
The current changelog lives in CHANGELOG.md. The most recent 2.1 entry summarises every feature, fix and personalisation option in this release.
Pre-2.0 history (upstream 1.0.x)
v1.0.8 (2025-11-28)
- Converted code comments from Traditional Chinese to English.
- Improved internationalisation standards.
- Pricing: added Opus 4.5 / Haiku 4.5 (thanks @mxzinke).
- Added German (de-DE) translation (thanks @mxzinke).
v1.0.7 (2025-11-28)
- Multilingual translation for hourly usage labels.
- Removed hardcoded Chinese text; switched to i18n.
v1.0.6 (2025-08-10)
- Added support for Claude Opus 4.1 pricing.
v1.0.5 (2025-01)
- Hourly usage statistics + visualisation.
v1.0.4 (2025-01)
- All-time data calculation; "All Time" translations.
v1.0.3 (2025-01)
- Repository URL migration + README image link fixes.
v1.0.0 (2025-01)
- Initial complete release.
Contributing
Issues and pull requests are welcome on the GitHub repository.




