https://github.com/ezoosk/claude-context-bar
VScode extension enabling real-time context window monitoring for Claude Code sessions. See token counts in your status bar with color-coded warnings.
https://github.com/ezoosk/claude-context-bar
anthropic antigravity claude claudecode context vscode windsurf
Last synced: 6 months ago
JSON representation
VScode extension enabling real-time context window monitoring for Claude Code sessions. See token counts in your status bar with color-coded warnings.
- Host: GitHub
- URL: https://github.com/ezoosk/claude-context-bar
- Owner: ezoosk
- License: mit
- Created: 2025-12-22T16:41:34.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-12-29T12:44:55.000Z (6 months ago)
- Last Synced: 2026-01-01T13:15:52.347Z (6 months ago)
- Topics: anthropic, antigravity, claude, claudecode, context, vscode, windsurf
- Language: TypeScript
- Homepage:
- Size: 76.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Claude Context Bar
**Real-time context window monitor for Claude Code sessions in VS Code**
## Features
๐ง **Live Context Tracking** โ See your Claude Code context usage percentage right in the status bar
โก **Per-Tab Monitoring** โ Each Claude Code tab gets its own context indicator
๐ฏ **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 detects your model (Sonnet 4.5 1M vs others) and adjusts the context limit accordingly
โ ๏ธ **Color-Coded Warnings**:
- Normal: Under 50% usage
- Warning (yellow background): 50-75% usage
- Danger (red background): Over 75% usage
๐ **Detailed Tooltips** โ Hover to see:
- First message (matches Claude Code tab name)
- 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)
## Requirements
- VS Code 1.74.0 or later
- [Claude Code](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code) extension installed and active
**Install:**
- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=ezoosk.claude-context-bar)
- [Open VSX Registry](https://open-vsx.org/extension/ezoosk/claude-context-bar) (for Antigravity, VSCodium, etc.)
## Configuration
| 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 context limit (auto-detected for most models) |
| `claudeContextBar.warningThreshold` | `50` | Percentage for yellow warning |
| `claudeContextBar.dangerThreshold` | `75` | Percentage for red danger |
| `claudeContextBar.refreshInterval` | `30` | Refresh interval in seconds |
| `claudeContextBar.idleTimeout` | `180` | Seconds of inactivity before hiding a session (3 minutes) |
| `claudeContextBar.compactMode` | `false` | Shorten project names to save status bar space |
| `claudeContextBar.shortNames` | `{}` | Custom short names for projects (e.g., `{"my-project": "MP"}`) |
## How It Works
The extension reads Claude Code's session files from `~/.claude/projects/` and calculates token usage from the JSONL logs. It automatically detects which model you're using and adjusts the context limit:
- **Claude Sonnet 4.5 1M**: 1,000,000 tokens
- **All other models** (Sonnet 4.5, Opus 4.5, Haiku): 200,000 tokens
Sessions inactive for more than 3 minutes (configurable via `idleTimeout`) are automatically hidden. 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.
## License
MIT ยฉ 2025 [Ed Zisk](https://github.com/ezoosk)