Practical, validated techniques to maximize token efficiency in the GitHub Copilot CLI — plus runnable scripts and switchable model profiles. Tips are mapped to features that actually exist in the CLI (verified against v1.0.63), not generic advice.
Built and validated against
@xavierxmorris's setup on 2026‑06‑16. Sources cited indocs/token-efficiency-guide.md.
The guide is split into two tiers so you never sacrifice answer quality by accident:
- Tier A — zero quality loss. Same answers, fewer tokens. (Caching, subagents, scoped
@file, trimming unused tools, keeping max context smartly.) - Tier B — worth-it tradeoffs. May lower quality; use deliberately. (Lower effort for routine work, cheaper model for low-stakes turns, compacting stale history.)
- Maximize prompt caching (zero quality loss). Cached input bills at ~10% (Anthropic)
/ up to 90% off (OpenAI) for the identical output. Keep your prefix stable. See
docs/prompt-caching.md. - Offload to subagents (
explore,task) — isolated context, summary-only return. - Keep max context the smart way —
contextTier: long_contextonly when needed; keep auto-compaction on (threshold ~0.85–0.88), don't disable it. - Trim only unused MCP tool definitions (before the session — toggling mid-session busts the cache).
- Lower effort for routine work (Tier B) —
xhigh → high/mediumsaves the most reasoning tokens; keepxhigh/maxfor hard tasks. - Avoid wrong turns — the biggest hidden cost. A bad approach pollutes context and re-bills
(at cache-read rate) on every later turn, anchors the model, and forces correction + cleanup —
often 3–10× cost plus a quality drop. Prevent with plan mode +
@file+explore/rubber-duck;/rewindearly to excise it. See the guide's "real cost of a wrong turn" section. - Route cheap models to the right jobs. Haiku / GPT‑5 mini / Gemini Flash match frontier
models on scoped, verifiable, high‑volume work (explore, run tests, summarize, pattern edits)
at a fraction of the cost — run them as isolated subagents so only summaries return. See
docs/lower-tier-models.md.
Full details: docs/token-efficiency-guide.md ·
Caching deep dive: docs/prompt-caching.md ·
Lower-tier models: docs/lower-tier-models.md ·
Reference setup analysis: docs/your-setup-analysis.md ·
CodeAct on Windows (hands-on eval): docs/codeact-windows-evaluation.md.
| Profile | Default model | Effort | When |
|---|---|---|---|
power |
claude-opus-4.8 |
max (subagents GPT‑5.5 xhigh) |
Maximum capability (documented default) |
lean |
claude-sonnet-4.6 |
medium |
Token-efficient everyday work |
Both use the real settings schema verified from the CLI package:
model, effortLevel, contextTier, and subagents.agents.<agent-name> with
per‑agent model / effortLevel / contextTier. Valid agents:
explore, task, code-review, rubber-duck, research, general-purpose.
# 1. See what you're currently paying for (read-only)
./scripts/check-usage.ps1
# 2. Audit your config for token waste (read-only)
./scripts/audit-config.ps1
# 3. Switch profiles (backs up your settings.json first)
./scripts/switch-profile.ps1 power # maximum capability
./scripts/switch-profile.ps1 lean # frugal
./scripts/switch-profile.ps1 lean -WhatIf # preview without writingScripts target
~/.copilotby default; override with-CopilotDir. PowerShell 5.1+ (Windows) or PowerShell 7 (cross‑platform).switch-profile.ps1is the only script that writes — and it backs up first.
copilot-token-efficiency/
├── docs/
│ ├── token-efficiency-guide.md # Tier A (zero loss) + Tier B (tradeoffs)
│ ├── prompt-caching.md # Input-token caching deep dive + how to max it
│ ├── lower-tier-models.md # Max capability + efficiency from cheap/fast models
│ └── your-setup-analysis.md # Findings for the reference setup
├── examples/
│ ├── settings.power.json # Opus 4.8 max + GPT-5.5 xhigh profile
│ ├── settings.lean.json # Token-efficient profile
│ ├── mcp-config.minimal.json # Trimmed MCP / tool allowlists
│ └── copilot-instructions.md # Context-discipline custom instructions
├── demo/
│ ├── demo-flow.md # Live demo script — show the token save (VS Code + CLI)
│ ├── presenter-notes.md # Answer key for the demo (kept out of the fixture)
│ └── sample-repo/ # Runnable fixture (5 tests, 1 failing by design)
└── scripts/
├── switch-profile.ps1 # Apply lean/power (with backup)
├── check-usage.ps1 # Token-posture dashboard (read-only)
└── audit-config.ps1 # Flag token waste + fixes (read-only)
You can't have both "maximum capability by default" and "minimum tokens" — Opus 4.8 max
- GPT‑5.5
xhighis the most expensive configuration. This repo's stance: run power as the default for quality, claw back tokens within it via discipline (compact/new, subagents, scoped@context, trimmed MCP), and one‑command switch to lean when you want to be frugal.
MIT — see LICENSE.