Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Token Monitor For ClaudeNew to Visual Studio Code? Get it now.
Token Monitor For Claude

Token Monitor For Claude

mofixiang

|
1 install
| (0) | Free
Real-time Claude Code API usage monitor — tokens, cache hit rate, and API balance in the status bar
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Usage Monitor

Real-time Claude Code API usage monitor for VS Code — shows cumulative token usage, cache hit rate, and API key balance directly in the status bar.

Status bar preview

Features

  • 📊 Cumulative Token Tracking — Automatically scans Claude Code session transcripts (~/.claude/projects/*.jsonl) and aggregates token usage per model
  • 🗄️ Cache Hit Rate — Calculates prompt cache hit rate from cache_read_input_tokens data, with color-coded status bar indicator
  • 💳 API Balance — Queries DeepSeek balance API to show remaining credits
  • ⏱️ Auto-Refresh — Configurable refresh interval (default: 5 minutes)
  • 🔍 Detailed View — Click status bar for per-model breakdown, hover for full stats in markdown tooltip

Supported Backends

Backend Token Tracking Cache Hit Rate Balance
DeepSeek (api.deepseek.com) ✅ ✅ ✅
Anthropic (api.anthropic.com) ✅ ✅ ❌ (balance requires Anthropic Console API)
Other Anthropic-compatible providers ✅ ✅ ❌

Requirements

  • VS Code 1.80+
  • Claude Code installed and configured
  • DeepSeek API key (for balance checking; token tracking works without it)

Usage

The extension activates automatically on VS Code startup. Look for the status bar item in the bottom-right corner:

⚡ v4-pro 2.15M tok  🗄 96.2%  💳 ¥23.50

Interactions

Action Result
Click status bar Open detailed QuickPick panel with per-model stats
Hover status bar Markdown tooltip with full breakdown table
Cmd/Ctrl+Shift+P → Claude Usage Monitor: Refresh Now Manually trigger refresh
Cmd/Ctrl+Shift+P → Claude Usage Monitor: Show Detailed Usage Open detail panel

Color Coding

Indicator Green Yellow Red
Cache hit rate ≥ 80% 50–79% < 50%

Extension Settings

Setting Type Default Description
claudeUsageMonitor.refreshIntervalMinutes number 5 Refresh interval (1–60 min)
claudeUsageMonitor.showBalance boolean true Show API balance in status bar
claudeUsageMonitor.showCacheHitRate boolean true Show cache hit rate in status bar
claudeUsageMonitor.claudeDataDir string (auto) Claude Code data directory path
claudeUsageMonitor.deepseekApiKey string (auto) DeepSeek API key for balance check

How It Works

  1. Token data — Parses every type: "assistant" entry in Claude Code's JSONL session files, extracting input_tokens, output_tokens, cache_read_input_tokens, and cache_creation_input_tokens grouped by model name
  2. Cache hit rate = cache_read_input_tokens / (cache_read_input_tokens + input_tokens)
  3. Balance — Queries GET https://api.deepseek.com/user/balance with your API key
  4. All data stays local — no telemetry, no external servers

Privacy

This extension:

  • ✅ Reads only local Claude Code files on your machine
  • ✅ Makes API calls only to DeepSeek's balance endpoint (with your key)
  • ✅ Sends NO data to any third party
  • ✅ Contains NO telemetry or analytics

Release Notes

1.0.0

  • Initial release
  • Per-model token tracking from local JSONL transcripts
  • Cache hit rate calculation with color-coded status bar
  • DeepSeek balance API integration
  • Configurable auto-refresh timer
  • QuickPick detail panel and markdown hover tooltips
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft