Optimizing GitHub Copilot: Better Results, Fewer Tokens

Emily Rothrock and Shivani Sundaresan walk through practical ways to optimize GitHub Copilot Chat so it produces better outputs with less token usage.

Overview

This episode focuses on how GitHub Copilot uses context and tokens, and how developers can actively manage both to improve response quality and reduce wasted usage.

What “context” includes

The presenters explain that Copilot’s responses depend heavily on what information is currently in scope, including:

How Copilot processes information as tokens

They describe how Copilot processes the available context as tokens, and why both extremes can cause problems:

Viewing context with /context

They demonstrate using the /context command to inspect what Copilot is currently considering, helping you verify whether the right files and information are included.

Understanding the context window

The video explains the idea of a context window (using a “suitcase” analogy) to show that there is a limited amount of information Copilot can carry forward at once.

Example: generating content without enough project context

They show an example of generating a case study page without sufficient project context, then improving results by adding relevant project files so Copilot has the right grounding.

Refreshing project context with /init

They demonstrate refreshing or re-establishing context using:

Guiding Copilot with copilot-instructions.md

They call out how a copilot-instructions.md file can steer Copilot’s behavior and outputs by providing consistent, project-specific guidance.

Starting focused sessions and checking usage

They cover how to begin a session with the right scope and then validate what’s being used:

Reducing token usage with /compact

They demonstrate using:

Series context and resources

This is Episode 5 of 10 in the “Build your personal brand with Copilot” student series.

Timeline (from the video description)