A Visual Studio Code/Cursor/Windsurf extension for monitoring OPENAI Codex rate limits in real-time.
- Status Bar Display: Shows 5-hour and weekly usage percentages directly in the VSCode status bar
- Color-coded Indicators: Visual warnings when approaching rate limits
- Detailed View: Click the status bar to see comprehensive rate limit information
- Automatic Updates: Refreshes every 10 seconds to keep data current
- TUI-style Interface: Familiar progress bars similar to the Python CLI tool
For most users, simply search for "Codex Rate Limit Monitor" in your editor's extension marketplace and install it directly.
npm install -g @vscode/vsce# Navigate to the extension directory
cd codex-ratelimit-vscode
# Install dependencies and compile
npm install
npm run compile
# Package into .vsix file
vsce packageThis creates a codex-ratelimit-X.X.X.vsix file.
Option A: Using VSCode UI
- Open VSCode
- Go to Extensions panel (
Ctrl+Shift+XorCmd+Shift+X) - Click the
...menu → "Install from VSIX..." - Select the
.vsixfile you created
Option B: Using Command Line
code --install-extension codex-ratelimit-X.X.X.vsixOption C: Using VSCode Command Palette
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "Extensions: Install from VSIX..."
- Select the
.vsixfile
After installation, reload VSCode window (Ctrl+Shift+P → "Developer: Reload Window") to activate the extension.
The extension displays rate limit information in the VSCode status bar:
⚡ 5H: 45% | Weekly: 23%
- 5H: 5-hour session usage percentage
- Weekly: Weekly limit usage percentage
- Colors change based on usage levels (green → yellow → red)
Click the status bar item or use the command Codex Rate Limit: Show Details to open a detailed view showing:
- 5-hour session progress (time and usage)
- Weekly limit progress (time and usage)
- Reset times and outdated status indicators
- Token usage summary
Prefer a terminal workflow? The codex-ratelimit project provides a single-file Python CLI/TUI tool that mirrors the progress bars and live rate-limit updates used here.
codex-ratelimit.refreshStats- Manually refresh rate limit datacodex-ratelimit.showDetails- Open detailed rate limit viewcodex-ratelimit.openSettings- Open extension settings page
The extension can be configured through VSCode settings:
codexRatelimit.enableLogging- Enable detailed logging for debuggingcodexRatelimit.enableStatusBarColors- Enable color-coded status barcodexRatelimit.warningThreshold- Usage percentage for warning colors (default: 70%)codexRatelimit.refreshInterval- How often to refresh stats in seconds (5-3600, default: 10)codexRatelimit.sessionPath- Custom path to Codex sessions directory
The extension monitors Codex session files located at ~/.codex/sessions/ by default. It:
- Searches for the latest
token_countevents in session files using a two-phase, modification-time-based scan (fast path checks today's files from the last hour, fallback walks all session files from the previous seven days by most recent edit) - Extracts rate limit information (5-hour and weekly limits)
- Calculates usage percentages and time progress
- Updates the status bar every 10 seconds
- Handles outdated data and error states gracefully
- Visual Studio Code 1.96.0 or higher
- Node.js for development
- Open the extension directory in VSCode
- Install dependencies:
npm install
- Compile TypeScript:
npm run compile
- Press
F5to launch a new Extension Development Host window - The extension will activate automatically
# Watch for changes (auto-recompile on file changes)
npm run watch
# Manual compilation when needed
npm run compile
# Run the extension for testing
# Press F5 in VSCode to launch Extension Development Hostsrc/
├── extension.ts # Main extension entry point
├── services/
│ ├── ratelimitParser.ts # Core logic for parsing session files
│ └── logger.ts # Logging utilities
├── handlers/
│ ├── statusBar.ts # Status bar management
│ └── webView.ts # Detailed view WebView
├── utils/
│ └── updateStats.ts # Stats update and refresh logic
└── interfaces/
└── types.ts # TypeScript type definitions
MIT License