Cursor Usage Monitor

A VS Code extension that displays real-time Cursor AI usage statistics in the status bar. Monitor your API usage, track remaining requests, and stay informed about your billing cycle.

Current Status
Note: All Cursor plans (Free, Pro, Business) now use usage-based billing (token-based). This extension automatically detects your account type and displays usage accordingly.
Features
- Auto Token Detection: Automatically reads your Cursor authentication token from local SQLite database
- Auto Account Detection: Detects your billing type from Cursor API
- Real-time Status Bar Display: Clean, minimal display showing today's cost or request count
- Usage-Based Support: Shows cost in dollars/cents for token-based billing
- Detailed Usage Panel: Click to view usage statistics with Apple-inspired design
- Activity History: View recent requests with model, tokens, and cost
- Auto-refresh: Configurable automatic refresh interval
- Secure Token Storage: Your API credentials are stored securely using VS Code's secret storage
- Debug Logging: Output channel for troubleshooting
Installation
From VS Code Marketplace
- Open VS Code
- Press
Ctrl+P / Cmd+P
- Type
ext install cursor-usage
- Press Enter
From VSIX File
- Download the
.vsix file from Releases
- Open VS Code
- Press
Ctrl+Shift+P / Cmd+Shift+P
- Type "Install from VSIX"
- Select the downloaded file
Build from Source
# Clone the repository
git clone https://github.com/lixwen/cursor-usage-monitor.git
cd cursor-usage-monitor
# Install dependencies
npm install
# Compile
npm run compile
# Package
npm run package
Configuration
Automatic Token Detection
The extension automatically detects your Cursor authentication token from Cursor's local SQLite database. No manual configuration is needed - it works out of the box on all platforms.
How it works:
- Uses sql.js (pure JavaScript SQLite implementation)
- No external dependencies required
- Falls back to
sqlite3 command if available
Manual Token Setup (if auto-detection fails)
- Open Command Palette (
Ctrl+Shift+P / Cmd+Shift+P)
- Type "Cursor Usage: Set Session Token"
- Follow the instructions to get your token from browser cookies
How to get your token manually:
- Open https://cursor.com/settings in your browser
- Press F12 to open Developer Tools
- Go to Application → Cookies →
cursor.com
- Find
WorkosCursorSessionToken and copy its value
- Paste the token when prompted
Extension Settings
Configure the extension in VS Code settings (File > Preferences > Settings):
| Setting |
Description |
Default |
cursorUsage.refreshInterval |
Refresh interval in seconds (minimum 60) |
60 |
cursorUsage.showInStatusBar |
Show usage information in status bar |
true |
cursorUsage.displayMode |
Display mode: requests, percentage, or both |
both |
cursorUsage.billingModel |
Your billing plan: free, pro, business, or usage-based |
pro |
cursorUsage.autoDetectToken |
Automatically detect token from Cursor's local database |
true |
Example Settings
{
"cursorUsage.refreshInterval": 300,
"cursorUsage.showInStatusBar": true,
"cursorUsage.displayMode": "both",
"cursorUsage.billingModel": "pro",
"cursorUsage.autoDetectToken": true
}
Commands
| Command |
Description |
Cursor Usage: Refresh Usage Data |
Manually refresh usage statistics |
Cursor Usage: Show Usage Details |
Open detailed usage panel |
Cursor Usage: Set Session Token |
Configure your Cursor session token |
Cursor Usage: Clear Saved Token |
Clear stored token (useful for debugging) |
Status Bar Display
The status bar shows your usage in a clean, minimal format:
| Billing Type |
Display Example |
Description |
| Usage-Based |
Cursor $0.03 |
Today's cost in dollars |
| Usage-Based |
Cursor 2.64¢ |
Today's cost in cents (if < $0.01) |
| Request-Based |
Cursor 5/50 |
Requests used / limit |
Billing Plans
All Cursor plans now use token-based billing:
| Plan |
Billing Type |
Display |
| Free |
Usage-Based (Token) |
Cost per request |
| Pro |
Usage-Based (Token) |
Cost per request |
| Business |
Usage-Based (Token) |
Cost per request |
Privacy & Security
- Secure Storage: Your API credentials are stored using VS Code's secure secret storage
- Local Processing: All data processing happens locally on your machine
- No Telemetry: This extension does not collect or transmit any usage data
Troubleshooting
"Not authenticated" Error
- Ensure you're logged in to Cursor (the application, not the browser)
- Check if
sqlite3 is installed: run sqlite3 --version in terminal
- Check the Output panel (
Ctrl+Shift+U → select "Cursor Usage Monitor") for detailed logs
- Try setting the session token manually via Command Palette
- Make sure to copy the complete token value (including
user_XXXXX:: prefix)
- Restart VS Code after setting the token
Auto-detection Not Working
- Ensure Cursor is installed and you have logged in at least once
- Verify
sqlite3 is installed on your system
- Check the Output panel for error messages
- Try disabling auto-detection (
cursorUsage.autoDetectToken: false) and set token manually
Data Not Updating
- Check your internet connection
- Try the "Refresh Usage Data" command
- Session tokens may expire - try setting a new token from browser cookies
Status Bar Not Visible
- Check that
cursorUsage.showInStatusBar is set to true
- Look for the item on the right side of the status bar
- Try reloading VS Code (
Ctrl+Shift+P → "Reload Window")
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature)
- Commit your changes (
git commit -m 'Add some AmazingFeature')
- Push to the branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
Development
# Install dependencies
npm install
# Watch mode for development
npm run watch
# Run linter
npm run lint
# Build for production
npm run compile
Project Structure
cursor-usage/
├── src/
│ ├── extension.ts # Extension entry point
│ ├── cursorApi.ts # Cursor API service
│ ├── statusBar.ts # Status bar management
│ └── types.ts # TypeScript type definitions
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
├── README.md # This file
└── LICENSE # MIT License
Roadmap
Account Type Support
| Account Type |
Status |
Notes |
| Free |
✅ Supported |
Token-based billing |
| Pro |
✅ Supported |
Token-based billing |
| Business |
✅ Supported |
Token-based billing |
| Team |
✅ Supported |
Token-based billing |
Planned Features
- [x] Support for all account types
- [x] Auto-detect account type from API
- [x] Usage-Based billing (cost tracking)
- [ ] Multi-account switching support
- [ ] Usage history and trends visualization
- [ ] Export usage data to CSV/JSON
Changelog
0.1.5
- New: All account types now supported (Free, Pro, Business, Team)
- New: Auto-detect billing type from
/api/auth/stripe
- New: Apple-inspired minimal design for details panel
- Improved: Clean status bar format:
Cursor $0.03 or Cursor 2.64¢
- Improved: Activity list shows recent requests with time, model, tokens, cost
- Fixed: Correct parsing of
tokenUsage.totalCents from API
0.1.4
- New: Support for usage-based billing detection
- Automatically detects billing type (request-based vs usage-based)
- Shows cost for usage-based billing, requests for request-based
- Detailed tooltip shows recent requests and costs
- Improved: Cleaner status bar display
0.1.3
- Improved: No longer requires
sqlite3 to be installed
- Uses sql.js (pure JavaScript SQLite) for token detection
- Falls back to sqlite3 command if sql.js fails
- Works out of the box on all platforms
0.1.2
- Improved: Friendlier status bar icons without pressure
- Replaced warning/flame icons with check/graph/zap/rocket
- Removed colored backgrounds for normal usage levels
- Only highlight when requests are completely exhausted
0.1.1
- New: Automatic token detection from Cursor's local SQLite database
- New:
autoDetectToken configuration option (default: enabled)
- New:
Clear Saved Token command for debugging
- New: Output channel logging for troubleshooting
- Improved: Error handling and logging throughout the extension
0.1.0
- Initial release
- Real-time status bar display
- Team account support (request-based billing)
- Detailed usage panel
- Configurable refresh interval
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Enjoy! If you find this extension helpful, please consider giving it a ⭐ on GitHub!