Track your Claude subscription usage (5-hour and 7-day limits) directly in the VS Code status bar.
Features
Live status bar — see your 5-hour and 7-day utilization at a glance
Color-coded warnings — status bar turns yellow at 70% and red at 90% (configurable)
Countdown to reset — hover for exact reset times
Auto-detect credentials — finds your Claude Code OAuth token on Windows automatically
Secure storage — tokens are stored in VS Code's encrypted SecretStorage
Setup
Option A: Automatic (if you have Claude Code installed)
The extension will attempt to find your Claude Code credentials automatically from:
~/.claude/.credentials.json (primary — this is where Claude Code writes them)
Windows Credential Manager (fallback — Claude Code uses this on some setups)
CLAUDE_CODE_OAUTH_TOKEN environment variable
If found, it starts working immediately — no setup needed.
Option B: Manual token entry
Open the Command Palette (Ctrl+Shift+P)
Run Claude Usage: Set Token
Paste your OAuth token (starts with sk-ant-oat…)
Finding your token
Credentials file: Open %USERPROFILE%\.claude\.credentials.json — copy the accessToken value
Windows Credential Manager: Open Credential Manager → Windows Credentials → look for a claude-code or Claude Code-credentials entry
Claude Code CLI: If you haven't logged in yet, run claude once — it will create the credentials file after you authenticate
Commands
Command
Description
Claude Usage: Refresh
Immediately re-fetch usage data
Claude Usage: Set Token
Enter/update your OAuth token
Claude Usage: Clear Token
Remove the stored token
Settings
Setting
Default
Description
claudeUsage.pollIntervalSeconds
120
How often to poll (min 30s)
claudeUsage.warningThreshold
70
Usage % where status bar turns yellow
claudeUsage.criticalThreshold
90
Usage % where status bar turns red
Building from source
cd claude-usage-tracker
npm install
npm run compile
To test locally, press F5 in VS Code with this folder open — it launches an Extension Development Host.
To package as a .vsix:
npm install -g @vscode/vsce
vsce package
Then install with code --install-extension claude-usage-tracker-0.1.0.vsix.
How it works
The extension calls an undocumented Anthropic endpoint (/api/oauth/usage) using your Claude Code OAuth token. This is the same endpoint Claude Code itself uses to display usage via the /usage command.
Important caveats:
This is an unofficial, undocumented API — it could change or break at any time
The usage numbers reflect your total subscription usage across Claude.ai, Claude Code, and Claude Desktop
The token may expire and need to be re-entered periodically