Token Optimization Guide
Practical guide to reducing GitHub Copilot token spend while keeping answers and code useful.
Start with Part 1 Jump to Practical Setup
What This Covers
- Why token usage actually costs money under Usage-Based Billing
- Why output control usually beats prompt compression on raw ROI
- How to shrink always-on context, history, and tool overhead
- How model-specific prompt guides improve first-pass quality and reduce rework
- When Ask Mode, Edit Mode, and Agent Mode make financial sense
- How to set enterprise guardrails without relying on unsupported controls
- How to turn this repo into repeatable team habits
Fastest Wins
- Constrain output by default:
Code only, no explanation.andNo explanations unless asked. - Keep
.github/copilot-instructions.mdsmall and specific. - Use Ask Mode for questions that do not need tools.
- Retune prompts and instructions against the official guide for your target model.
- Disable MCP servers you are not using.
- Audit long-running agent sessions and repeated back-and-forth.
- Install RTK — CLI proxy that filters
git, test runners,grep, and 100+ other shell commands before output reaches the agent. One install, 60-90% savings on tool-call results in agent and coding-agent sessions.
Read by Topic
Foundations
Techniques
Implementation
Quick Terms
- UBB: usage-based billing. Copilot Business and Enterprise spend is tracked through AI-credit usage rather than request counters.
- AI credits: the pooled billing unit used after the cutover.
- Auto mode: Copilot's default model selector. Good default lane when you do not need to pin a model.
- Ask Mode: single-shot interaction. Lowest-overhead choice for simple questions.
- Agent Mode: multi-step interaction. Higher leverage, higher cost.
- Content Exclusion: admin control for keeping selected repo content out of Copilot context.
Useful Links
- Official GitHub Copilot docs
- Usage-based billing for organizations and enterprises
- OpenAI Tokenizer
- Awesome GitHub Copilot Customizations
- LLMLingua
- Caveman project
- RTK — Rust Token Killer
- Dina Berry: "How I Cut Token Usage from 52% to 13%" — real measured numbers from a Copilot CLI production setup (Microsoft/GitHub content contributor)
Notes
/chronicle(full, all subcommands) is Copilot CLI./chronicle:tipsis also available in VS Code.- Usage-Based Billing is labeled UBB in this repo.