Skip to content

osbornecox/claude-usage-bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude Usage Bar

Real-time Claude Code token usage in your VSCode status bar.

License: MIT

Features

  • Session usage — percentage of your 5-hour rate limit block used
  • Weekly usage — 7-day rolling usage across all models
  • Active model — Opus, Sonnet, Haiku
  • Time since update — shows how stale the displayed data is
  • Color alerts — yellow at 70%, red at 90% usage
  • Click to refresh — instant manual update
  • Error resilience — falls back to last known good data on API errors (429, network issues)

Updates automatically every 60 seconds. No API keys required — uses your existing Claude Code credentials.

Prerequisites

This extension requires claude-pulse (the script that reads Claude Code usage data):

curl -fsSL https://raw.githubusercontent.com/NoobyGains/claude-pulse/main/install.sh | sh

You also need:

Installation

From VSIX

Download the latest .vsix from Releases, then:

code --install-extension claude-usage-bar-0.1.0.vsix

From source

git clone https://github.com/osbornecox/claude-usage-bar.git
cd claude-usage-bar
npm install
npm run package
code --install-extension claude-usage-bar-0.1.0.vsix

Configuration

Open Settings and search for "Claude Usage Bar":

Setting Default Description
claudeUsageBar.refreshInterval 60 Refresh interval in seconds (30-300)
claudeUsageBar.alignment left Status bar position: left or right
claudeUsageBar.pythonPath auto Custom path to Python 3 binary
claudeUsageBar.scriptPath auto Custom path to claude_status.py

How it works

  1. On startup, the extension locates claude_status.py (installed by claude-pulse) and a Python 3 interpreter
  2. Every 60 seconds, it runs the script and captures its output
  3. ANSI colors, progress-bar characters, context window, and update indicators are stripped
  4. The result is displayed in the status bar with color-coded alerts and a freshness timer
  5. On API errors (429 rate limit, network issues), the last successful data is shown instead

The underlying script fetches usage data from Anthropic's OAuth API using your existing Claude Code session. No additional authentication is needed.

Troubleshooting

"claude-pulse not installed" - Run the install command from Prerequisites.

"Python 3 not found" - Install Python 3 or set claudeUsageBar.pythonPath in settings to your Python binary path.

"script error" - Hover over the status bar item to see the error details. Common causes:

  • Claude Code CLI not authenticated (run claude in terminal first)
  • Outdated claude-pulse version (run the install command again to update)

Credits

Powered by claude-pulse by @NoobyGains.

License

MIT

About

Real-time Claude Code token usage in your VSCode status bar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors