Claude Usage Monitor
A VS Code status-bar widget that shows your Claude Code token usage, estimated
cost, and burn rate — read directly from the local session logs written by both
Claude Code (~/.claude/projects/**/*.jsonl) and Claude Desktop's local agent
mode (%APPDATA%/Claude/local-agent-mode-sessions/**, or the macOS/Linux
equivalent). No network calls, no API keys.
What it shows
🤖 5h:42% 7d:67% $1.23 ~2h14m
| Segment |
Meaning |
5h:42% |
Output tokens used in the last 5 hours / configured cap |
7d:67% |
Output tokens used in the rolling 7-day window / weekly cap |
$1.23 |
Estimated cost of the current 5-hour window (computed from tokens) |
~2h14m |
Time until 5h cap is exhausted at the last-30-min burn rate |
Background color:
- default when under 50 %
- yellow (
statusBarItem.warningBackground) at 50 – 80 %
- red (
statusBarItem.errorBackground) above 80 %
Click the item to open a dashboard webview with hourly bars for the last 24 h
and reset countdowns.
Install (development / personal use)
npm install
npm run compile
Then press F5 in VS Code to launch an Extension Development Host with the
extension loaded. The status bar item appears at the bottom-left.
Install (as .vsix)
npm run package
code --install-extension claude-usage-monitor-0.1.0.vsix
Publish to the Marketplace
- Create a publisher at https://marketplace.visualstudio.com/manage
- Generate an Azure DevOps Personal Access Token with scope
Marketplace → Manage.
- Update
publisher in package.json to your publisher name.
npx vsce login <publisher> (paste the PAT).
npm run publish.
Configuration
| Setting |
Default |
Description |
claudeUsageMonitor.cap5hOutputTokens |
40000 |
Estimated 5-hour output-token cap |
claudeUsageMonitor.sessionsPerDay |
8 |
Sessions per day, used for weekly cap |
claudeUsageMonitor.refreshIntervalSec |
60 |
Recompute interval (also re-runs on changes) |
claudeUsageMonitor.logsRoot |
"" |
Override path to logs; empty = ~/.claude/projects |
How pricing is calculated
Cost is computed from message.usage token counts on every assistant row
(the costUSD field is rarely present in the logs, so it is always ignored).
Per-model prices live in src/pricing.ts and fall back to
Sonnet 4.6 when the model string isn't recognized.
License
MIT — see LICENSE.