Claude Code (VS Code)
The VS Code extension is a companion that surfaces Token Optimizer data in the status bar. The engine and the hooks still run inside the Claude Code process, which means you install the Claude Code CLI plugin first, then add this VSIX on top. The extension reads the files the plugin writes to ~/.claude/token-optimizer/.
Prerequisites
Section titled “Prerequisites”- The Token Optimizer plugin installed in Claude Code (see Claude Code (CLI)). Without it, the status bar has nothing to read.
- VS Code, Cursor, or Windsurf. The VSIX works in all three.
Install
Section titled “Install”-
Download
token-optimizer-statusline-<version>.vsixfrom the GitHub release. -
Install it from the command line:
code --install-extension token-optimizer-statusline-<version>.vsixOr in the editor: Extensions →
...→ Install from VSIX.
The Claude Code extension itself is the same two /plugin commands as the CLI. This VSIX is the separate companion that renders the data in the status bar.
What the status bar shows
Section titled “What the status bar shows”Two status-bar items plus a hover tooltip covering:
- Context fill percent with a bar.
- ContextQ, the resource health grade and score.
- Eff, the session efficiency grade and score.
- Warnings for fill, tool fatigue, and regime change.
- Compactions and estimated context loss.
- Session duration and active subagents.
- 5-hour and 7-day usage limits with reset times.
Usage limits read as “verified” from the Claude statusline cache, “estimated” when computed locally from the transcript, or “cached” with the age of the last captured value shown.
Parity with the CLI
Section titled “Parity with the CLI”Everything the CLI does, the extension does, because the same hooks run in the VS Code Claude Code process.
| Feature | CLI | VS Code |
|---|---|---|
| Smart Compaction (checkpoint and restore) | Yes | Yes |
| Quality tracking and session data | Yes | Yes |
| All hooks (SessionEnd, PreCompact, and others) | Yes | Yes |
Dashboard at localhost:24842/token-optimizer | Yes | Yes (click a status-bar item) |
| Active compression | Yes | Yes |
| Status line (quality bar) | Terminal | VS Code status bar (this VSIX) |
Dashboard bookmark
Section titled “Dashboard bookmark”Click either status-bar item to open the dashboard at http://localhost:24842/token-optimizer. The extension does zero network activity except one localhost probe to that port, and only when you click. To keep the URL live between sessions, set up the daemon from the CLI:
python3 measure.py setup-daemonVerify
Section titled “Verify”The VSIX has no separate doctor. Use the underlying plugin’s doctor:
python3 measure.py doctorTo force the panel to re-read the cache, use the Token Optimizer: Refresh Now button.
Uninstall
Section titled “Uninstall”Remove the extension from the VS Code Extensions panel, or:
code --uninstall-extension token-optimizer-statuslineThe underlying plugin uninstalls separately. See Claude Code (CLI).
See also
Section titled “See also”- Claude Code (CLI) for the required plugin install.
- Claude Code platform reference for the full capability list.
- Configuration for environment variables, including the
tokenOptimizer.runtimesetting that points the extension at Copilot.