Claude Token ViewMonitor your Claude Code token usage directly in the VS Code status bar. See your current 5-hour session usage and 7-day weekly usage at a glance, with progress bars, color-coded levels, reset countdowns, and a tiny pixel-art Claude mascot that idles next to the session meter.
Features
InstallFrom the MarketplaceSearch for "Claude Token View" in the VS Code Extensions view, or:
From a
|
| Claude Code version | Writer |
|---|---|
≤ 2.1.100 |
Claude Code writes the file itself. |
≥ 2.1.109 |
The Claude Token View statusLine helper writes it. |
On 2.1.109 the CLI moved usage tracking to response-header parsing
(anthropic-ratelimit-unified-5h-utilization, ...-7d-utilization, etc.)
and now only exposes it to user-configured statusLine commands as
rate_limits.five_hour.used_percentage / seven_day.used_percentage in
the JSON piped on stdin.
The helper reads that stdin, converts it back to the legacy cache shape, and writes the file atomically. The extension watches the file exactly as before — so the same render code path works on both versions.
When the cache's updatedAt is older than
claudeTokenView.staleThresholdMinutes (default 15), the status bar
switches to a warning and the tooltip offers one-click install of the
hook.
Settings
All settings live under claudeTokenView.*.
| Setting | Default | Description |
|---|---|---|
claudeTokenView.enableNotifications |
true |
Show a toast when usage crosses the threshold and when the limit is reached. |
claudeTokenView.sessionNotificationThreshold |
90 |
Percent at which to notify for the 5-hour session usage. |
claudeTokenView.weeklyNotificationThreshold |
80 |
Percent at which to notify for the weekly (7-day) usage. |
claudeTokenView.refreshIntervalSeconds |
30 |
How often (seconds) to re-read the cache file as a fallback to the file watcher. |
claudeTokenView.progressBarLength |
10 |
Length of the progress bar in characters. |
claudeTokenView.showCharacter |
true |
Show the Claude mascot next to the 5-hour item. |
claudeTokenView.enableAnimation |
true |
Animate the mascot's squat-and-stand cycle. Requires showCharacter. |
claudeTokenView.animationPeriodMs |
2000 |
Full animation cycle length in milliseconds (each half = one frame). |
claudeTokenView.showSessionItem |
true |
Show the 5-hour session item in the status bar. |
claudeTokenView.showWeeklyItem |
true |
Show the weekly (7-day) item in the status bar. |
claudeTokenView.cacheFilePath |
"" |
Override the path to vscode-claude-status-cache.json. Leave empty for the default ~/.claude/. |
claudeTokenView.staleThresholdMinutes |
15 |
If the cache's updatedAt is older than this, the status bar shows a stale warning + one-click hook installer. |
Commands
| Command | Palette title |
|---|---|
claudeTokenView.refresh |
Claude Token View: Refresh Now |
claudeTokenView.openSettings |
Claude Token View: Open Settings |
claudeTokenView.installStatusLine |
Claude Token View: Install Claude Code Status Line Hook |
claudeTokenView.uninstallStatusLine |
Claude Token View: Uninstall Claude Code Status Line Hook |
Clicking either status bar item also triggers a refresh.
Requirements
- VS Code
>= 1.80 - Claude Code installed and run at least once, so the cache file exists.
Privacy
- No network requests
- No telemetry
- No tokens consumed (does not call the Anthropic API)
- Reads exactly one local file:
~/.claude/vscode-claude-status-cache.json
Known limitations
- On Claude Code 2.1.109+, usage updates only happen while a Claude Code session is running (the helper is driven by its statusLine, which is evaluated per user/assistant turn). Idle users will see a stale warning until the next Claude Code interaction.
- When
limitStatusis anything other than"allowed", the item color is forced to red regardless of the raw percent. The helper cannot populate this field on 2.1.109+ (it is not part of the statusLine JSON), so the limit-status colour override is effectively disabled on newer CLIs — exhaustion still shows as red via the 100 % raw-percent threshold.
Contributing & development
git clone https://github.com/IwataHiroki0827/ClaudeTokenView.git
cd ClaudeTokenView
npm install
npm run build:icons # SVG → WOFF
npm run build:icon-png # SVG → Marketplace icon
npm run compile # TypeScript
Then press F5 in VS Code to launch an Extension Development Host.
To redesign the mascot: edit the SVGs under icons/ (32×32 viewBox), then
run npm run preview:icons to render images/preview.png and
npm run build:icons to regenerate the WOFF.
See PUBLISHING.md for the Marketplace publishing flow.
License
MIT — see LICENSE.
