Skip to content

GitHub Copilot (VS Code)

Copilot support is in beta. VS Code Copilot runs on the same adapter as Copilot CLI, so there is no separate install. It is treated as a distinct session population and is never merged with CLI sessions. One manual settings step unlocks per-request credit costs, and one optional step points the Claude Code status-bar extension at Copilot.

  • GitHub Copilot in VS Code.
  • The Copilot adapter installed. Run the Copilot (CLI) install; there is no VS Code-specific install beyond it.

Run bash install.sh --copilot from the cloned repo, exactly as on the Copilot (CLI) page. That shared adapter install covers VS Code too.

The installer does not flip these settings for you, because they log full prompt text to disk. That is a VS Code and Copilot behavior, so the switch is yours to make.

  1. Open VS Code settings.

  2. Enable both github.copilot.chat.agentDebugLog settings.

With debug logs on, the adapter reads per-request copilotUsageNanoAiu from main.jsonl, which is the authoritative cost figure. When debug logs are off, it falls back to the OTel agent-traces.db. On cost, the VS Code surface is actually richer than CLI, because CLI persists only an aggregate at session shutdown.

Cost figures use Copilot’s own numbers. For VS Code that is the per-request nanoAIU value above. Tune the conversion rates with the same variables as CLI:

TOKEN_OPTIMIZER_COPILOT_USD_PER_CREDIT (default 0.01)
TOKEN_OPTIMIZER_COPILOT_PREMIUM_RATE (default 0.04 per premium request)

See Configuration for the full list.

Runtime switch in the status-bar extension

Section titled “Runtime switch in the status-bar extension”

If you also use the Claude Code status-bar VSIX, point it at Copilot in VS Code settings:

"tokenOptimizer.runtime": "copilot"

The extension then reads from ~/.copilot/token-optimizer/ and resolves the active session from ~/.copilot/session-state/<id>/events.jsonl. All status-bar items, quality scores, and usage-limit displays work the same way; only the source directory changes. The setting takes effect immediately, no reload.

Terminal window
TOKEN_OPTIMIZER_RUNTIME=copilot python3 skills/token-optimizer/scripts/measure.py copilot-doctor

copilot-doctor distinguishes which source is active per surface, CLI versus VS Code.

Terminal window
TOKEN_OPTIMIZER_RUNTIME=copilot python3 skills/token-optimizer/scripts/measure.py copilot-uninstall

Turn off both github.copilot.chat.agentDebugLog settings if you no longer want full prompt text written to disk.