Optimizing GitHub Copilot: Better Results, Fewer Tokens @MicrosoftDeveloper
Optimizing GitHub Copilot: Better Results, Fewer Tokens  @MicrosoftDeveloper
Uploaded August 2026 | Updated November 2026, 3 days ago
Optimize GitHub Copilot context and token usage to get better AI results with fewer tokens. Learn how the context window works and use /context, /init, and /compact to keep Copilot sessions focused, accurate, and efficient.

Episode 5 of 10 in Build your personal brand with Copilot. Continue to Episode 6 and explore the full series:
https://aka.ms/student-learning-series-website

Build your personal brand with Copilot is a beginner-friendly Microsoft Developer series for students. Follow Microsoft employees as they use GitHub Copilot, Visual Studio Code, GitHub Pages, Microsoft Foundry, MCP servers, and agent skills to create, publish, and improve a professional portfolio website.

In this episode:
0:00 Welcome and an introduction to context and tokens
0:21 What context includes
0:38 How Copilot processes information as tokens
0:46 Viewing context with /context
0:53 Understanding the context window with a suitcase analogy
1:04 Why too little or too much context can hurt results
2:07 Generating a case study page without project context
3:04 Adding project files for better results
3:57 Refreshing project context with /init
4:02 How copilot-instructions.md guides Copilot
5:02 Starting a focused session with the right context
6:08 Checking context usage
6:44 Reducing token usage with /compact
7:11 Recap of context and token optimization

Connect with the presenters:
Emily Rothrock - Software Engineer at Microsoft: linkedin.com/in/emily-rothrock
Shivani Sundaresan - Software Engineer at Microsoft: linkedin.com/in/shivanisundaresan

Resources:
Download the prompts, code, and episode artifacts from GitHub: https://aka.ms/student-learning-series
Learn more about GitHub Copilot: https://aka.ms/StudentAI-GitHubCopilotApp

Some features and cloud services may have eligibility, usage, or cost limits. Review the current terms before creating resources.

Subscribe to Microsoft Developer for more practical developer and AI learning:
youtube.com/@MicrosoftDeveloper

#GitHubCopilot #PromptEngineering #AITools
Optimizing GitHub Copilot: Better Results, Fewer TokensJoin us for MCP Live! Sept 9th!✈️ Powering the Cockpit: Boost Your M365 Flight Crew | Boost Microsoft 365 with Cowork, Scout & MoreVS Gets AI Agents + MCP C# SDK 2.0 and MoreCooking Up Smarter Dev Docs, on Mr. Maedas Cozy AI KitchenWork IQ: Tooling with MCP & CLIBuild Reusable Copilot Workflows with Skills and AgentsQDK Tutorial: Learn Quantum Computing with GitHub Copilot in VS CodeWeb IQ: Grounding Agents with Real World IntelligenceModernize Your Portfolio with Bootstrap and GitHub CopilotAI Toolkit + GitHub Copilot - Pt. 3:  Create an Agent with ToolsZoomIt for Mac: How AI Ported a 20+ Year-Old Windows Tool
Microsoft Developer |

Optimizing GitHub Copilot: Better Results, Fewer Tokens

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER