A VS Code, Cursor, Windsurf extension that monitors your Claude Code CLI usage directly in the status bar.
- Status Bar Integration: Shows current session usage percentage in the VS Code status bar
- Detailed Tooltips: Hover over the status bar item to see detailed usage information including:
- Current session (5-hour) usage with progress bar
- Current week (all models) usage with progress bar
- Current week (Opus) usage (if available)
- Reset times and timestamps
- Auto-refresh: Configurable automatic refresh intervals
- Manual Fetch: Click the status bar item or use the command to fetch usage data manually
- Startup Fetch: Option to fetch usage data when VS Code starts
- Claude Code CLI installed and authenticated (
claude login) - tmux installed (for headless CLI interaction)
- Node.js and npm
- Clone or download this extension
- Run
npm installin the extension directory - Run
npm run compileto build the extension - Run
npx vsce packageto generate the.vsixfile - Install the extension in VS Code:
- Open VS Code
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "Extensions: Install from VSIX"
- Select the generated
.vsixfile
The extension provides the following configuration options (accessible via VS Code Settings):
claudeCodeUsage.fetchOnStartup: Automatically fetch usage data when VS Code starts (default: true)claudeCodeUsage.autoRefreshMinutes: Auto-refresh interval in minutes (default: 5, set to 0 to disable)
- Ensure Claude Code CLI is installed and you're logged in (
claude login) - The extension will automatically start monitoring usage
- Click the status bar item or use the "Claude Code: Fetch Usage Now" command to manually refresh
- Hover over the status bar item to see detailed usage information
This extension uses the provided claude_usage_capture.sh script to interact with the Claude Code CLI in a headless tmux session. The script:
- Launches Claude Code in a detached tmux session
- Waits for the TUI to boot
- Sends the
/usagecommand - Captures and parses the usage information
- Returns the data as JSON
The extension then displays this information in the VS Code status bar with appropriate icons and colors based on usage levels.
The extension provides helpful error messages for common scenarios:
⚠️ Init Required: Workspace needs to be initialized with Claude Code- 🔑 Auth Required: Need to run
claude login ⚠️ CLI Not Found: Claude Code CLI not installed⚠️ tmux Not Found: tmux package not installed
- claude_usage_capture.sh script: Obtained from jazzyalex/agent-sessions repository. All credits for this script go to jazzyalex (Alexander Malakhov).
- Claude Code CLI: Developed by Anthropic. This extension monitors usage of their Claude Code CLI tool.
MIT
Note: This is an unofficial extension and is not affiliated with Anthropic or Claude.ai.
