Real-time context window monitor for Claude Code sessions in VS Code
🧠 Live Context Tracking — See your Claude Code context usage right in the status bar
⚡ Per-Tab Monitoring — Each Claude Code tab gets its own context indicator
🏷️ Session Titles — Hover shows the Claude Code session name. Optionally use it on the status bar when several tabs share a project
🎯 Fuzzy Emoji Matching — Icons automatically match your project type based on name keywords:
- 🎵 Music/audio projects
- 🎮 Games
- 🌐 Web/frontend
- 📱 Mobile apps
- 🤖 AI/ML projects
- 🔧 Tools/extensions
- And many more...
🎨 Auto Color Mode — Each project automatically gets a unique pastel color for easy identification
🔍 Smart Context Detection — Automatically sizes the context window per model (1M for current models, 200K for Haiku and legacy), with per-model overrides
- Normal: Under 50% usage
- Warning (yellow background): 50-75% usage
- Danger (red background): Over 75% usage
📊 Detailed Tooltips — Hover to see:
- Session title (when Claude Code has generated or you have named one)
- First message
- Model name
- Cache Read / Cache Creation tokens
- Total context used vs limit
- Last updated time
🔄 Auto-Refresh — Updates automatically when sessions change or every 30 seconds
🧹 Smart Session Detection — Automatically hides "ghost" sessions when you close tabs or run /clear
👆 Click to Hide — Click any context bar item to temporarily hide it; reappears on new activity
📐 Compact Mode — Shorten project names to save space (my-cool-project → MCP, typescript → Tscript)
💯 Token Display — Optionally show absolute tokens on the status bar (185K) instead of percent (18%)
✴️ Subscription Usage — Opt-in (off by default): see your Claude /usage Session (5-hour) limit as its own status bar item (e.g. ✴️ 7%), with color-coded warnings independent of the context colors. Hover for the full breakdown (Weekly, and per-model limits like Weekly Fable) with reset times. Experimental, may stop working at any time (see Subscription usage)
- VS Code 1.74.0 or later
- Claude Code extension installed and active
Install:
- VS Code Marketplace
- Open VSX Registry (for Antigravity, VSCodium, etc.)
| Setting | Default | Description |
|---|---|---|
claudeContextBar.showEmoji |
true |
Show emoji icons based on project name keywords |
claudeContextBar.autoColor |
true |
Automatically assign unique pastel colors to each project |
claudeContextBar.baseColor |
White |
Base color when Auto Color is off (subtle variations per project) |
claudeContextBar.contextLimit |
200000 |
Fallback for unknown or non-Claude model IDs (Claude models are auto-detected) |
claudeContextBar.modelContextLimits |
{} |
Per-model overrides: Model ID → token limit (e.g., {"claude-haiku-4-5": 500000}). Exact match, highest priority |
claudeContextBar.warningThreshold |
50 |
Percentage for yellow warning |
claudeContextBar.dangerThreshold |
75 |
Percentage for red danger |
claudeContextBar.showUsage |
false |
Opt-in: show your Claude subscription usage (the 5-hour session limit from /usage) as a separate item. Experimental, may stop working at any time |
claudeContextBar.usageWarningThreshold |
50 |
Usage percentage for yellow warning (independent of context) |
claudeContextBar.usageDangerThreshold |
75 |
Usage percentage for red danger (independent of context) |
claudeContextBar.usageRefreshInterval |
60 |
How often (seconds) to refresh subscription usage from the /usage endpoint |
claudeContextBar.refreshInterval |
30 |
Refresh interval in seconds |
claudeContextBar.idleTimeout |
180 |
Seconds of inactivity before hiding a session (3 minutes). Set 0 to never hide idle sessions |
claudeContextBar.configDir |
"" |
Claude Code config directory (the folder that contains projects/). Empty = CLAUDE_CONFIG_DIR, then ~/.claude |
claudeContextBar.compactMode |
false |
Shorten project names to save status bar space |
claudeContextBar.shortNames |
{} |
Custom short names for projects (e.g., {"my-project": "MP"}) |
claudeContextBar.label |
project |
Status bar name: project (folder) or session (Claude Code title) |
claudeContextBar.usageFormat |
percent |
Status bar usage: percent or tokens (e.g. 185K). Warning colors still use percent |
The extension reads Claude Code's session files from <configDir>/projects/ and calculates token usage from the JSONL logs. <configDir> is claudeContextBar.configDir if set, otherwise the CLAUDE_CONFIG_DIR environment variable, otherwise ~/.claude. VS Code launched from the Start Menu or Finder often does not inherit shell-only env vars — use the setting in that case.
It resolves the context limit per model using this priority chain:
- User override — the
modelContextLimitssetting (exact Model ID match). Highest priority, overrides everything below. - 200K models — Haiku and legacy generations (Claude 3.x, Sonnet 4.5 and earlier, Opus 4.5 and earlier) resolve to 200,000 tokens.
- 1M default — every other current Claude model resolves to 1,000,000 tokens (Opus 4.6+, Sonnet 4.6+, Sonnet 5, Fable 5, and anything newer).
- Fallback — unknown or non-Claude Model IDs use the
contextLimitsetting (default 200,000).
Claude session files record only the Model ID, with no context-window field, so the limit is inferred from the ID. The default is 1M because current frontier models all ship with a 1M window, which means new models resolve correctly with no update needed. Haiku and legacy models are the 200K exceptions. If any model is ever mis-sized (for example, your plan caps a model lower than its API window), pin an exact value in modelContextLimits and it always wins.
Sessions inactive for more than 3 minutes (configurable via idleTimeout, 0 disables hiding) are automatically hidden, and reappear as soon as a resumed session writes new activity. The window regaining focus also triggers an immediate rescan. The extension also detects when sessions have been superseded by newer ones (e.g., after running /clear and opening a new tab), hiding ghost sessions immediately.
Experimental, off by default. This feature relies on an undocumented Anthropic endpoint (the one Claude Code's own
/usagecommand reads). Treat it as a temporary bonus: it may change or stop working at any time, entirely at Anthropic's discretion. Enable it withclaudeContextBar.showUsage: true.
The context percentage is computed entirely from local files. The subscription usage (the /usage limits) is different: it is fetched from Claude's authenticated GET /api/oauth/usage endpoint, using the OAuth token that Claude Code stores in your OS credential store (macOS Keychain item Claude Code-credentials, or <configDir>/.credentials.json on Linux/Windows). This is the same data and the same mechanism Claude Code uses for its own /usage command; the token is used only as the request's Authorization header and is never logged or stored by the extension.
Usage is refreshed on its own cadence (usageRefreshInterval, default 60 seconds, independent of the context refresh) and the last known value is kept during transient failures. The endpoint rate-limits frequent polling, so avoid setting the interval very low. If you are not signed in with a Claude subscription (for example, using an API key), the usage item simply doesn't appear. Turn it off entirely with showUsage.
MIT © 2025-2026 Ed Zisk