Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Claude Token ViewNew to Visual Studio Code? Get it now.
Claude Token View

Claude Token View

Roki

|
1,003 installs
| (0) | Free
Display Claude Code token usage (5h session / 7d weekly) in the VS Code status bar with progress bars, colored levels, reset countdowns, and an animated pixel-art Claude mascot.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Token View

Monitor 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.

mascot frames

Read-only. This extension never talks to any API and never consumes tokens. It only reads a local cache file at ~/.claude/vscode-claude-status-cache.json. No telemetry, no network traffic, zero runtime dependencies.


Quick start

  1. Open Claude Code at least once so that the ~/.claude/ directory exists.
  2. Claude Code 2.1.109 or newer — open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run:

    Claude Token View: Install Claude Code Status Line Hook

  3. Use Claude Code as usual. Two items appear in the status bar — 5h and 7d — and update each time Claude Code refreshes its statusline (every user/assistant turn).

That's it. On Claude Code 2.1.100 or older no setup is required; the CLI writes the cache file itself.

To stop tracking later, run Claude Token View: Uninstall Claude Code Status Line Hook — this restores any previous statusLine command and removes the helper script.


Reading the status bar

🟢 5h ██████░░░░ 52%      7d ████░░░░░░ 36%
  • The 5h item is the current 5-hour session window.
  • The 7d item is the rolling 7-day weekly window.
  • Click either item to refresh immediately.
  • Hover to see the exact percentage, raw bar, reset timestamp, and remaining time.
  • When a window is exhausted, the item flips to a countdown: 5h █████████░ reset in 1h 23m.

Color levels

All levels are text colors (no jarring background swaps):

Usage Color
< 50% green (charts.green)
50% – 90% yellow (charts.yellow)
>= 90% red (charts.red)

The progress bar uses half-block characters, so 52% looks visibly different from 50% even at the default 10-character bar length.

The mascot

A pixel-art Claude sits next to the 5h item (the 7d row stays compact). Its expression tracks usage, and it inherits the status bar text color — so it goes green → yellow → red along with the bar.

Usage Expression
< 50% happy (eyes only)
50 – 75% neutral (eyes + small dash mouth)
75 – 95% worried (eyes + small open mouth)
>= 95% panic (eyes + wide open mouth)

A subtle squat-and-stand idle animation runs on a 2-second cycle. Both the mascot and its animation can be disabled — see Settings.

Notifications

Two independent toasts can fire for each window:

  • A warning toast when usage crosses sessionNotificationThreshold (default 90%) or weeklyNotificationThreshold (default 90%).
  • An error toast when the window actually hits 100% (max), including the time remaining until that window resets.

Each fires once per crossing and re-arms only after usage drops at least 5% below the threshold (hysteresis), so they won't spam you when you're hovering right at the line.

Both close themselves after claudeTokenView.notificationAutoDismissSeconds (default 10) — the notification's progress bar is the countdown, and its cancel button closes it immediately. Set the value to 0 if you'd rather have a notification that stays until you dismiss it and carries an "Open Settings" button.


How the status line hook works

Claude Code 2.1.109 stopped writing ~/.claude/vscode-claude-status-cache.json itself. Usage data is now exposed only as a rate_limits JSON object piped to whatever statusLine command you register in ~/.claude/settings.json.

The bundled installer wires that up for you:

  1. Copies statusline-cache-writer.js to ~/.claude/claude-token-view-statusline.js.
  2. Registers it as statusLine in ~/.claude/settings.json. Any previously configured custom statusLine is preserved under previousStatusLine so you can recover it.
  3. Each time Claude Code refreshes its statusline, the helper reads the piped JSON, converts it back to the cache shape this extension understands, and writes it atomically.

The helper is a single zero-dependency Node script — no network calls, no external processes — it only reads stdin and writes one small JSON file. The uninstall command restores previousStatusLine and deletes the copied helper.

Stale data

The statusLine hook only ticks while Claude Code is running, so the cache naturally stops refreshing whenever you're not actively prompting Claude. That's normal and not an error — an idle session consumes no tokens, so the last-known usage stays accurate and the reset countdown keeps ticking. The extension keeps showing those numbers; the tooltip notes how long ago the cache was last updated.

The stale warning (with a one-click hook installer) only appears when the cache is older than claudeTokenView.staleThresholdMinutes (default 15) and the statusLine hook is not installed in ~/.claude/settings.json — i.e. the genuine setup problem where the cache would never refresh. Once the hook is installed, idle sessions no longer trigger the warning.


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.notificationAutoDismissSeconds 10 Seconds before a usage notification closes itself. 0 keeps the old sticky toast.
claudeTokenView.sessionNotificationThreshold 90 Percent at which to notify for the 5-hour session usage.
claudeTokenView.weeklyNotificationThreshold 90 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 Minutes after which a stale-cache warning shows up with a one-click hook installer.

Run Claude Token View: Open Settings from the Command Palette to jump straight to the configuration UI.


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 or newer
  • Claude Code installed and run at least once so that ~/.claude/ exists

Privacy

  • No network requests
  • No telemetry
  • No tokens consumed (never calls the Anthropic API)
  • Reads exactly one local file: ~/.claude/vscode-claude-status-cache.json

License

MIT — see LICENSE.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft