Claude Code Usage Monitor
Monitor Claude Code API usage in VS Code with real-time statistics.
Important Notice
This is an unofficial, community-developed extension and is not affiliated with, endorsed by, or supported by Anthropic. "Claude" is a trademark of Anthropic.
This extension uses the same authentication mechanism as Claude Code CLI and does not require separate authentication.
Platform Compatibility: This extension has been developed and tested exclusively on macOS. While it may work on other platforms, functionality on Windows and Linux has not been verified and may require additional configuration or may not work at all.
Features
- Status Bar Integration: See your Claude API usage at a glance in the VS Code status bar
- Real-time Monitoring: Automatically updates usage statistics every 5 minutes (configurable)
- Detailed Statistics: View comprehensive usage information in a dedicated sidebar
- Usage Alerts: Get notified when your usage exceeds configurable thresholds
- Multiple Windows: Track 5-hour, 7-day, and 7-day Opus usage windows
- No Re-authentication: Uses your existing Claude Code CLI credentials
Screenshots
Status Bar


Requirements
- macOS: This extension has been developed and tested exclusively on macOS. It uses macOS Keychain for authentication and has not been tested on Windows or Linux.
- Claude Code CLI: Must be authenticated with Claude Code CLI (
claude command)
- VS Code: Version 1.85.0 or higher
Note: While the extension may technically work on other operating systems, it has only been verified to work on macOS. Use on Windows or Linux is at your own risk and may require modifications.
Installation
From Source
- Clone or download this repository
- Install dependencies:
cd claude-usage-monitor
npm install
- Update the publisher ID in
package.json:
"publisher": "your-publisher-id"
- Compile the extension:
npm run compile
- Package the extension:
npm run package
- Install the generated
.vsix file:
code --install-extension claude-code-usage-monitor-0.1.0.vsix
Setup
- Ensure you're authenticated with Claude Code CLI:
claude
- Reload VS Code
- The extension will automatically start monitoring your usage
Usage
Status Bar
The status bar item shows your current maximum usage across all windows:
$(pulse) Claude 45% - Normal usage (< 75%)
$(warning) Claude 80% - Warning usage (75-90%)
$(alert) Claude 95% - Critical usage (≥ 90%)
Click the status bar item to open the detailed statistics view.
The extension adds a "Claude Code Usage Monitor" sidebar with:
- Detailed Statistics: Webview with progress bars and visual indicators
Commands
Available commands (accessible via Cmd+Shift+P):
Claude Code Usage Monitor: Refresh Claude Usage - Manually refresh usage data
Claude Code Usage Monitor: Show Detailed Usage - Open the detailed statistics view
Claude Code Usage Monitor: Login to Claude Code - Get help with authentication
Configuration
Configure the extension in VS Code settings (Cmd+,):
| Setting |
Type |
Default |
Description |
claude-usage-monitor.updateInterval |
number |
300 |
Update interval in seconds (minimum 60) |
claude-usage-monitor.showNotifications |
boolean |
true |
Show notifications when usage is high |
claude-usage-monitor.warningThreshold |
number |
90 |
Warning threshold percentage (0-100) |
claude-usage-monitor.apiKey |
string |
"" |
Optional API key (CLI auth preferred) |
Example Configuration
{
"claude-usage-monitor.updateInterval": 180,
"claude-usage-monitor.showNotifications": true,
"claude-usage-monitor.warningThreshold": 85
}
How It Works
- Authentication: Reads OAuth credentials from macOS Keychain (same credentials used by Claude Code CLI)
- API Calls: Fetches usage data from
api.anthropic.com/api/oauth/usage
- Caching: Stores usage data locally in
~/.claude/stats-cache.json (5-minute cache)
- Updates: Automatically refreshes usage data at configured intervals
- Notifications: Shows warning when usage exceeds threshold
Troubleshooting
"Not authenticated" error
- Ensure you're logged in with Claude Code CLI:
claude
- Check that credentials are stored in Keychain:
security find-generic-password -s "Claude Code-credentials"
No usage data shown
- Try manually refreshing:
Cmd+Shift+P → "Refresh Claude Usage"
- Check the Output panel for errors: View → Output → "Claude Code Usage Monitor"
- Ensure you have an active internet connection
Extension not working on Windows/Linux
This extension has been developed and tested exclusively on macOS. It relies on macOS Keychain for authentication, which is not available on Windows or Linux.
Windows/Linux users: The extension has not been tested on these platforms and may not work without significant modifications to the authentication mechanism. Support for other platforms may be added in future releases, but is not currently guaranteed.
Privacy & Security
- Local Storage: All data is stored locally on your machine
- No Logging: OAuth tokens are never logged or transmitted to third parties
- HTTPS Only: All API calls use HTTPS encryption
- Keychain Security: Credentials are stored securely in macOS Keychain
Development
Building from Source
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode (auto-compile on changes)
npm run watch
# Package extension
npm run package
Testing
- Open the project in VS Code
- Press
F5 to launch Extension Development Host
- Test the extension in the new window
Known Limitations
- macOS only: Developed and tested exclusively on macOS. Keychain access requires macOS, and the extension has not been verified to work on Windows or Linux.
- OAuth only: Only supports OAuth authentication (not API keys)
- Read-only: Cannot modify usage limits or settings via API
- Unofficial API: Uses undocumented API endpoints that may change without notice
Roadmap
- [ ] Windows and Linux support (Credential Manager, Secret Service)
- [ ] Historical usage charts
- [ ] Cost tracking and estimation
- [ ] Multi-account support
- [ ] Export usage reports (CSV/JSON)
- [ ] Desktop notifications
- [ ] Usage prediction (ML-based)
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT
Disclaimer
This is an unofficial, community-developed extension.
- Not affiliated with, endorsed by, or supported by Anthropic
- "Claude" is a trademark of Anthropic
- Uses undocumented API endpoints that may change or be discontinued at any time
- Tested exclusively on macOS - functionality on other platforms is not guaranteed
- Provided "as is" without warranty of any kind (see LICENSE for details)
Use this extension at your own risk. The developers are not responsible for any issues arising from its use.
Acknowledgments
Note: This is an unofficial extension and is not affiliated with Anthropic. "Claude" is a trademark of Anthropic.