Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Token Usage (debug)New to Visual Studio Code? Get it now.
Token Usage (debug)

Token Usage (debug)

S.Chen

|
2 installs
| (0) | Free
Shows AI token usage and cost per prompt in the status bar. Debug build: shows a startup report you can copy.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Token Usage

Status-bar cost and tokens for the current Claude Code or Cursor session.

$(graph) $0.42  ·  ↑12.4k ↓5.9k  ·  $31.50 left

Click the graph icon bottom-left of the window ($— until there is spend). If there is no usage yet, that click asks what to do next. If you still cannot see it, open the status bar … overflow, or search Token Usage in the Command Palette. You must Reload Window after installing a new vsix.

Disclaimer — this does not spend tokens

The extension does not call any AI model and does not add request quota.

It only reads:

  • Claude Code: JSONL transcripts already on disk (~/.claude/projects)
  • Cursor: the same usage dashboard Cursor already shows you, using Cursor’s stored session cookie to cursor.com (never sent anywhere else)

There is no extra AI usage from having it installed. No native modules, no downloads, no background completions.

Cursor uses a private API (cursor.com/api/dashboard/*). It is undocumented and can change. If it breaks, Claude Code readings are unaffected.

Setup

  1. Install the .vsix (or from the marketplace) and Developer: Reload Window.
  2. Open a folder (not a single file).
  3. Use an agent in that folder:
    • Claude Code — works once a transcript exists. No sign-in.
    • Cursor — be signed in to Cursor. The extension never prompts for credentials.
  4. If it looks empty, click the status bar item (or Command Palette → Token Usage: Why is this empty?). A first-install toast also points there.

Another computer / it looks like nothing installed

The extension is not on the marketplace unless you published it. Copy the .vsix and install it:

cursor --install-extension token-usage-0.3.1.vsix

Then Developer: Reload Window. Open a folder, not a single file. Run one prompt in that folder — there is nothing to show until this machine has local usage.

  • Cursor: sign in to Cursor on that computer (the extension never prompts).
  • Remote SSH / WSL: install the extension on the remote side too.
  • VS Code: Claude Code still works; Cursor spend needs Cursor’s own state.vscdb.
  • Settings in settings.json are per machine unless Settings Sync is on.

The bar should read Token Usage when idle. If even that is missing, the vsix did not load.

Settings that matter

Search Token Usage in Settings, or put this in settings.json:

{
  "tokenUsage.provider": "auto",
  "tokenUsage.display": "cost-and-tokens",
  "tokenUsage.cursor.costMode": "billed",
  "tokenUsage.budget.claudeUSD": 600,
  "tokenUsage.budget.cursorUSD": 50,
  "tokenUsage.budget.cycleStartDay": 1,
  "tokenUsage.budget.warnAtPercent": [75, 90, 100]
}
Setting Default
tokenUsage.provider auto auto (sticky while both are fresh), or pin claude-code / cursor
tokenUsage.auto.freshnessMinutes 3 Keep the current auto source if it moved within this window
tokenUsage.sessionScope conversation conversation, today, or 7d
tokenUsage.display cost-and-tokens Or cost / tokens for a shorter bar
tokenUsage.cursor.costMode billed billed = what Cursor charged. tokens = rate table × token counts (an estimate)
tokenUsage.budget.cursorUSD / claudeUSD 0 Monthly cap; 0 disables that source’s budget
tokenUsage.budget.cycleStartDay 1 Local calendar day the cycle starts
tokenUsage.budget.warnAtPercent [75, 90, 100] Toast only if spend is ahead of even pace, or at 100%
tokenUsage.pricing {} USD per million tokens, e.g. { "claude-sonnet-5": { "input": 3, "output": 15 } }
tokenUsage.claudeProjectsPath ~/.claude/projects Transcript root
tokenUsage.warnThresholdUSD 0 Highlight the bar above this session spend
tokenUsage.statusBar.alignment left left (easier to see) or right (Cursor’s crowded side, often in …)
tokenUsage.statusBarPriority 10 Higher sits further left within that side

Budget notes

  • Spend is account-wide, not this workspace. Claude and Cursor are separate bills.
  • After a warning threshold, the bar shows $/day left. The toast can open the dashboard, raise this cycle (this period only), or snooze until tomorrow.
  • Leave both budgets at 0 to skip the 5-minute account scan.

Cursor tokens mode is a local estimate. The dashboard labels it so it is not confused with billed cents.

Unknown models use the Opus fallback rate and are listed in diagnostics — they are never treated as free.

Commands

Search Token Usage in the Command Palette:

  • Show Dashboard
  • Why is this empty? — diagnostics
  • Refresh / Select Source
  • Copy Session Summary / Copy Cycle as CSV / JSON

Local cost (not AI)

What How often Touches
Claude Code session file change + 10s safety poll tail of the current transcript
Cursor session 60s one page of Cursor’s usage API + a read-only SQLite query
Monthly budget 5 min, only if a budget is set Cursor: paginated usage API. Claude: transcripts modified this cycle
Auto source 30s, only when provider is auto one stat and one SQLite MAX(), no network

Pin tokenUsage.provider to skip auto-detect. Charts are inline SVG (enableScripts: false).

Built-in rates (USD / million tokens)

Family Input Output
claude-fable-5, claude-mythos-5 10 50
claude-opus-5, claude-opus-4-* 5 25
claude-sonnet-5, claude-sonnet-4-* 3 15
claude-haiku-4-5 1 5
anything else 5 25

Cursor suffixes (-thinking-high, …) match the family. Override with tokenUsage.pricing. This table does not track vendor price changes by itself.

Development

npm install && npm run compile
npm run test:fixtures && npm run test:cursor-api && npm run test:detect
npm run test:sqlite && npm run test:budget && npm run test:dashboard
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft