Skip to content

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/.

  • 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.
  1. Download token-optimizer-statusline-<version>.vsix from the GitHub release.

  2. Install it from the command line:

    code --install-extension token-optimizer-statusline-<version>.vsix

    Or 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.

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.

Everything the CLI does, the extension does, because the same hooks run in the VS Code Claude Code process.

FeatureCLIVS Code
Smart Compaction (checkpoint and restore)YesYes
Quality tracking and session dataYesYes
All hooks (SessionEnd, PreCompact, and others)YesYes
Dashboard at localhost:24842/token-optimizerYesYes (click a status-bar item)
Active compressionYesYes
Status line (quality bar)TerminalVS Code status bar (this VSIX)

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:

Terminal window
python3 measure.py setup-daemon

The VSIX has no separate doctor. Use the underlying plugin’s doctor:

Terminal window
python3 measure.py doctor

To force the panel to re-read the cache, use the Token Optimizer: Refresh Now button.

Remove the extension from the VS Code Extensions panel, or:

code --uninstall-extension token-optimizer-statusline

The underlying plugin uninstalls separately. See Claude Code (CLI).