Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Claude Code Usage & Cost StatsNew to Visual Studio Code? Get it now.
Claude Code Usage & Cost Stats

Claude Code Usage & Cost Stats

nuwan

|
2 installs
| (0) | Free
Claude Code 5-hour and weekly limits at a glance in the status bar, with a token-usage dashboard and 7-day chart on click.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Code Usage & Cost Stats

Claude Code usage at a glance, right in the VS Code status bar:

  • Status bar: live 5-hour and 7-day (weekly) rate-limit utilization, e.g. 5h 42% · 7d 63%, with warning/error coloring as you approach the limits.
  • Hover it for a quick card: today / 7-day / month-to-date cost and tokens, your top model, and a 7-day sparkline — all before you even click.
  • Click it to open the full dashboard:
    • Rate-limit gauges with reset countdowns
    • Tokens and estimated cost consumed today (input / output / cache read / cache write)
    • Daily stacked bar chart of the last 7 days, with cost
    • Per-model breakdown table with cost and request counts
    • 6-month token trend line chart

Status bar hover tooltip
Status bar hover

Full dashboard
Full dashboard (click the status bar item)

How it works

  • Rate limits come from the same endpoint Claude Code's /usage command uses (api.anthropic.com/api/oauth/usage), authenticated with your existing Claude Code OAuth token (macOS Keychain, or ~/.claude/.credentials.json). These numbers are account-wide. No other data leaves your machine.
  • Token counts are parsed from Claude Code's local transcripts (~/.claude/projects/**/*.jsonl) — fully offline, with caching so refreshes only re-read changed files. These cover this machine only; usage from other devices or claude.ai is not included.

Requirements

  • Claude Code installed and signed in (claude → /login) with a Pro/Max subscription.
  • VS Code 1.85+.

Development

npm install
npm run compile

Then press F5 in VS Code to launch an Extension Development Host.

Package with:

npx @vscode/vsce package

Settings

Setting Default Description
claudeUsageStats.pollIntervalMinutes 5 How often to refresh limit data
claudeUsageStats.claudeDataDir ~/.claude Claude Code data directory
claudeUsageStats.warnThreshold 80 % at which status bar turns warning color
claudeUsageStats.dangerThreshold 95 % at which status bar turns error color

Caveats

  • The usage endpoint is unofficial; if Anthropic changes it, limit display degrades gracefully (token stats keep working).
  • Transcript retention follows Claude Code's cleanupPeriodDays (default 30 days), so 7-day history is normally complete.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft