A VS Code extension that displays real-time Claude Code usage statistics directly in your status bar.
The extension automatically starts monitoring when you open VS Code. The status bar shows real-time usage with color-coded warnings based on token usage:
Reset: 03:45:12 | C: 35.9% | T: 74.4% | M: 25.5%
Status Bar Components:
- Reset: Countdown timer to session reset (HH:MM:SS)
- C: Cost usage percentage
- T: Token usage percentage
- M: Message count percentage
Color Indicators:
- βͺ Neutral: < 75% of token limit
- π Orange: 75-89% of token limit
- π΄ Red: β₯ 90% of token limit
Hover over the status bar to see a quick tooltip with session timing and key metrics:
Click the status bar to open the main popup with comprehensive metrics:
Main popup view with session timer, token usage, cost tracking, and message count with visual progress bars
Main Popup includes:
- Progress bars for tokens, cost, and messages
- Percentage indicators
- Per-minute consumption rates (tokens/min, $/min, messages/min)
- Session timing information
- Token breakdown (input, output, cache creation, cache read)
Advanced Analytics - Click "More..." buttons to access detailed breakdowns:
Expanded view showing token breakdown by component, usage by model (Opus/Sonnet/Haiku), and usage by project
Extended information includes:
- Token Components: Individual counts of input, output, cache creation, and cache read tokens
- Burn Rate Analysis: Real-time token and cost consumption rates (tokens/min, $/min)
- Model Breakdown: Pie chart showing which models (Opus, Sonnet, Haiku) consumed the most tokens
- Project Breakdown: Visualization of token usage across different Claude projects
Simple configuration with just two settings:
- Plan: Choose from Pro, Max5, Max20, or Custom
- Refresh Interval: Update frequency (1-60 seconds)
{
"claudeStatusBar.plan": "max5", // pro, max5, max20, or custom
"claudeStatusBar.customTokenLimit": 44000, // Only for custom plan
"claudeStatusBar.refreshInterval": 5 // 1-60 seconds
}| Plan | Token Limit | Cost Limit | Message Limit |
|---|---|---|---|
| Pro | 19,000 | $18.00 | 250 |
| Max5 | 88,000 | $35.00 | 1,000 |
| Max20 | 220,000 | $140.00 | 2,000 |
| Custom | User-defined | $50.00 | 250 |
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "Claude Code Status Bar Monitor"
- Click Install
Or visit the VS Code Marketplace page
npm install
npm run package
code --install-extension claude-statusbar-0.1.0.vsixAccess via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
Claude: Show Usage Details- Open detailed metrics popupClaude: Set Plan to Pro- Switch to Pro plan (19k tokens)Claude: Set Plan to Max5- Switch to Max5 plan (88k tokens)Claude: Set Plan to Max20- Switch to Max20 plan (220k tokens)Claude: Set Plan to Custom- Set custom token limitClaude: Refresh Usage Stats- Force refresh metrics
Claude Code stores conversation data locally in JSONL files:
- Windows:
%USERPROFILE%\.claude\projects\ - macOS/Linux:
~/.claude/projects/or~/.config/claude/projects/
The extension monitors these files for changes and calculates metrics in real-time.
Claude Code uses 5-hour rolling sessions. The extension:
- Detects your first message timestamp
- Calculates session expiry (5 hours later)
- Tracks usage within the active window
- Automatically resets when session expires
What counts toward limits:
- β
input_tokens- Your prompts - β
output_tokens- Claude's responses
What doesn't count toward token limits:
- β
cache_creation_input_tokens- Cache overhead - β
cache_read_input_tokens- Cache hits
Note: Cache tokens ARE included in cost calculations but NOT in token limits.
Costs are calculated using model-specific pricing:
| Model | Input | Output | Cache Creation | Cache Read |
|---|---|---|---|---|
| Opus | $15.00/M | $75.00/M | $18.75/M | $1.50/M |
| Sonnet | $3.00/M | $15.00/M | $3.75/M | $0.30/M |
| Haiku | $0.25/M | $1.25/M | $0.30/M | $0.03/M |
Pricing per million tokens
All data processing happens locally on your machine:
- β No data sent to external servers
- β No telemetry or analytics
- β No account required
- β Reads only your local Claude files
- VS Code: 1.104.0 or higher
- Claude Code: Active installation with local conversation data
- Node.js: Only for development
npm install
npm run compilenpm run watchnpm run package
vsce packagenpm run testThis project was inspired by and built upon the excellent work of:
- yahyashareef48/claude-usage-monitor - Visual design and VS Code extension architecture
- Status bar layout and styling
- Webview panel implementation
- Real-time file watching approach
- Maciek-roboblog/Claude-Code-Usage-Monitor - Precise usage calculations
- Token counting methodology (excluding cache tokens from limits)
- Cost calculation formulas with model-specific pricing
- 5-hour rolling session window logic
- P90-based custom plan analysis
Note: This extension combines the best of both projects - accurate calculations from Maciek's monitor with the polished GUI from Yahya's extension.
MIT License - see LICENSE file for details.
For issues or feature requests, please visit the GitHub repository.
Enjoy monitoring your Claude Code usage! π
