Claude Code session monitor
Claude Code session monitor
ClaudeGauge is a Visual Studio Code extension that displays Claude Code usage quotas and live context window information directly in the editor's status bar. It provides a continuous readout of the current five-hour session usage, weekly quota, and the active chat's context window fill level. The extension mirrors the data shown by Claude Code's built-in /usage and /context commands, making this information always visible at the bottom of the VS Code window without requiring manual commands. The extension tracks multiple metrics simultaneously. The status bar shows abbreviated labels for current session (CS), weekly usage (WS), and context window fill (CTX), along with the time remaining until each limit resets. Hovering over the status bar item reveals progress bars, exact reset times, per-model weekly usage for Opus and Sonnet, pay-as-you-go credit balances, and trend sparklines. Users can configure notifications when usage crosses 80 percent or 90 percent thresholds. The display is color-coded: blue under normal conditions, turning yellow at 75 percent and red at 90 percent. A detailed split terminal view is available by running the "Claude Usage: Open Detailed View Beside Terminal" command from the Command Palette, providing an htop-style bars view that can be placed alongside the Claude terminal. Typical use cases include monitoring usage limits during extended coding sessions, tracking weekly quotas to avoid interruptions, and managing context window capacity when working with large conversations. The extension also supports multi-chat tracking and allows one-click resumption of closed chats. Daily token statistics are provided as well. The workflow is passive: the extension polls the Anthropic usage API every ten minutes and updates the status bar automatically. Users can click the status bar item to force an immediate refresh. Technically, ClaudeGauge reads the OAuth access token from the file ~/.claude/.credentials.json, which is already managed by Claude Code. No separate login is required. The token is re-read from disk on each poll to stay valid as long as Claude Code refreshes it. The extension sends requests only to Anthropic's own API endpoint at https://api.anthropic.com/api/oauth/usage. Results are cached to a temporary file to avoid redundant requests on reload, and if the API returns a 429 rate limit response, the extension backs off automatically for up to 30 minutes. ClaudeGauge is an unofficial community tool and is not affiliated with Anthropic. It relies on an undocumented endpoint, so functionality may change or break without notice.