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 (opt-in)
Optional AI advisor sends your aggregates + a sample of your prompts
to an OpenAI-compatible API (DeepSeek V4 Pro by default) and suggests
concrete rewrites. Bring your own key — or click 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 |
|---|---|---|
refreshInterval |
60 |
Refresh interval in seconds (min 30). |
dataDirectory |
"" |
Custom Claude data dir; empty = auto-detect. |
language |
"auto" |
UI language: auto / en / zh-TW / zh-CN / ja / ko. |
decimalPlaces |
2 |
Decimal places in cost display (0–4). |
compactNumbers |
false |
Show 1.2M / 345K instead of full numbers. |
timezone |
"" |
IANA timezone for date display (e.g. Asia/Hong_Kong). |
usageLimitTracking |
true |
Show real 5h / weekly quota in the status bar. |
enableContentAnalysis |
true |
Run the Content tab token analysis. |
projectGroupingMode |
"git" |
Projects tab grouping: git / folder / flat. |
advice.apiKey |
"" |
API key for the AI advice feature (OpenAI-compatible). |
advice.apiUrl |
https://api.deepseek.com/chat/completions |
Chat-completions endpoint. |
advice.model |
"deepseek-v4-pro" |
Model name. |
advice.reasoningEffort |
"max" |
Reasoning effort (DeepSeek V4: high / max). |
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. - The AI advice command is the only feature that calls an external
service — and only when you trigger it. It sends an aggregate summary
of your usage plus a sample of your recent user prompts to whatever
endpoint you configured in
advice.apiUrl. Bring your own key; nothing is shipped with the extension. If no key is configured, the command opens a hand-written demo instead of calling any API.
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:--%
- The OAuth token at
~/.claude/.credentials.jsonis missing or expired. Log in to Claude Code once; the extension reads its credential file read-only 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
- That means no API key is configured under
claudeCodeUsage.advice.apiKey. The demo file is filename-marked…-DEMO-…with a prominent banner. Add a key in Settings and re-run the command.
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/jack21/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
Forked from jack21/ClaudeCodeUsage. MIT-licensed.
- @Dobidop —
[PR #9](https://github.com/jack21/ClaudeCodeUsage/pull/9), the OAuth
approach for reading real
/usagedata. The quota indicator in this release is adapted from that work. - @nickearnshaw —
[PR #8](https://github.com/jack21/ClaudeCodeUsage/pull/8) locale-aware
number/date formatting;
[PR #20](https://github.com/jack21/ClaudeCodeUsage/pull/20) fix for
webview/status-bar getting stuck on "Loading…" (re-entrancy guard +
spinner only on cold start);
[PR #21](https://github.com/jack21/ClaudeCodeUsage/pull/21) docs
explaining
cleanupPeriodDaysfor retaining usage history. - @brenoneill — [PR #14](https://github.com/jack21/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).
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.0 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.




