Claude usage & Codex usage monitor for your status bar — track Claude Code and OpenAI Codex CLI rate limits side by side in VS Code, with 5-hour and weekly quotas, reset times, and alerts.
This independent extension is based on jun1485/claude-codex-usage, licensed under MIT; its copyright notice remains in the included LICENSE file. It is not the original Marketplace extension and is not affiliated with its publisher, Anthropic, or OpenAI.
Install
Search for AI Usage Monitor by YSTools in the VS Code Extensions view and install YSTools.ystools-claude-codex-usage. For local or offline installation, build a VSIX with npm.cmd ci and npm.cmd exec -- vsce package, then use Extensions: Install from VSIX... in VS Code. VS Code disables automatic updates for VSIX installations by default; you can enable Auto Update for the extension after publication.
If the upstream extension is also installed, disable one of the two to avoid duplicate status-bar entries. Their command and setting IDs are separate.
What you see
- Claude:
$(claude) Claude | $(clock) 7% 🟢 $(calendar) 41% 🟢
- Codex:
$(ai-usage-codex-logo) Codex | $(clock) 12% 🟢 $(calendar) 32% 🟢
- When Claude returns a separate Fable weekly quota, append
$(book) Fable 18% 🟢 to its status entry. The usage-circle setting also applies to Fable, and the entry background considers all displayed quotas. Other model-specific quotas remain in the hover table.
- Quota icons follow the actual window duration, including when Codex returns a weekly window as
primary. Five-hour and seven-day windows show only clock/calendar icons. Other durations retain labels such as $(clock) 15m or $(calendar) 30d. Unknown durations show a question icon and the Primary/Secondary label.
- Hover for details in account and usage tables: account/plan, 5-hour / weekly / per-model usage, time remaining until reset, reset date/time, and last update time. Table columns have dedicated gutters. The Used column includes the gauge and percentage. Choose horizontal bars or the original text meters in Settings. Both gauges use the same colors as the status-bar circles: green through 60% used, yellow through 70%, orange through 80%, and red above 80%.
- Codex and Claude hover details show quota usage without a separate session-token count.
- When an account is not logged in, its status entry says
Not Log in; the hover shows no fabricated usage and includes the login guidance.
- Each quota has its own usage circle: green through 60%, yellow through 70%, orange through 80%, and red above 80%. The status item uses the theme's warning background above 60% through 80% and error background above 80%, based on the highest usage among its displayed quotas, including Claude Fable when present.
- Claude failures show the reason in the status bar, such as
Auth expired, Rate limited, or Network error. Hover for details and next steps. Failed refreshes never present an earlier percentage as current usage.
- Claude uses VS Code's built-in
claude product icon on VS Code 1.109 or newer, with Unicode ✳ (U+2733) as a fallback on older versions. Codex retains its existing bundled glyph. The warning/error status-bar backgrounds are theme colors; VS Code does not support setting a custom background color for only this extension's items.
- Click for a quick menu: toggle Claude/Codex on or off, open settings, or refresh
Data sources
| Tool |
Source |
How |
| Claude Code |
OAuth token from ~/.claude/.credentials.json or the macOS Keychain |
Queries an Anthropic-hosted, undocumented usage endpoint (every minute by default while the window is focused, configurable) |
| Codex CLI |
Codex app-server account/read and account/rateLimits/read |
Reads the signed-in account's current quota without starting a model turn; never scans session logs |
The extension has no telemetry or publisher-owned server. It reads the Claude OAuth token locally and sends it as an authorization header to the Anthropic-hosted usage endpoint; it does not include that token in settings or the VSIX. For Codex, it starts the installed Codex CLI's app-server and uses its existing sign-in; it does not read or store Codex credentials or session logs. The hover tooltip shows the detected account name or email in full, so take care when sharing your screen.
Settings
| Setting |
Default |
Description |
aiUsageMonitor.refreshIntervalMinutes |
1 |
Refresh interval in minutes (1–60) |
aiUsageMonitor.alignment |
left |
Status bar position: left or right |
aiUsageMonitor.tooltipGaugeStyle |
bar |
Hover gauge: image bar or original text meter |
aiUsageMonitor.showUsageCircles |
afterPercentage |
off, after usage percent (published layout), or before the quota icon |
aiUsageMonitor.claude.enabled |
true |
Show Claude usage |
aiUsageMonitor.codex.enabled |
true |
Show Codex usage |
aiUsageMonitor.claude.credentialsPath |
"" |
Override Claude credentials file path |
aiUsageMonitor.codex.executablePath |
"" |
Override the Codex CLI executable (codex on PATH by default) |
The Claude and Codex visibility settings are checkboxes in VS Code Settings. The usage-circle setting is a three-choice dropdown; previously saved true/false values migrate to afterPercentage/off. Codex session token counts are not shown in the hover details. Warning and error backgrounds are fixed at 61% and 81% respectively; the Claude account name comes from the detected account rather than a display-name setting. UI preferences can use VS Code Settings Sync when enabled, while local credential/executable paths are machine-scoped and do not sync. The old aiUsageMonitor.codex.sessionsPath setting is no longer used. Settings from the upstream extension use a different prefix and are not migrated automatically.
Refreshing Codex sends only app-server account and rate-limit read requests, not a model turn. Automatic polling follows the configured interval while the window is focused; manual refresh and source changes also refresh. Changing a display-only setting does not make another provider request. Refreshing Claude sends a read-only request to an undocumented usage endpoint. No provider guarantee was found that polling never affects account limits, and excessive polling can trigger rate limiting, so the default is one minute.
Requirements
- Logged in to Claude Code (run
claude, then /login)
- Codex CLI available on PATH (or configured with
aiUsageMonitor.codex.executablePath) and signed in with ChatGPT
Known limitations
- If Claude sign-in expires, open Claude Code so it can try to renew the login; sign in again if prompted. The monitor does not renew or store credentials itself. Refresh usage after Claude Code has recovered, or wait for the next scheduled refresh.
- The Anthropic-hosted usage endpoint is undocumented and may change without notice.
- Codex's ChatGPT subscription quota is unavailable when the CLI uses API-key or Bedrock authentication. API usage is a separate billing system.
- If the Codex CLI or app-server is unavailable, or the account-limit response fails, the extension displays an unavailable state rather than an old session-log value. It does not invent a reset or a missing quota window.
- The Claude status-bar item is hidden when Claude is not detected. Codex displays an unavailable state when its CLI cannot be found.
- Refresh pauses while the window is unfocused and resumes (with an immediate refresh) on focus.
- Compatibility with VS Code-derived editors such as Cursor, Windsurf, and VSCodium has not been verified.
Localization
English by default; Korean (한국어), Japanese (日本語), and Chinese (简体中文 / 繁體中文) UI when the VS Code display language matches. The weekly quota label remains Weekly in English and Korean.
Icon credit
The Marketplace icon is Box carton delivery ecommerce by Fredy Sujono, sourced from Icon-Icons. Its listing marks it free for commercial use. The icon is a third-party asset; the project's MIT license does not grant additional rights to it or to the Claude and OpenAI marks shown in the status bar. Those marks belong to their respective owners; this extension is not endorsed by them.