If Content is King, Then Context is God
Diving Deeper into Context
To find out the prompts that Copilot builds from your context, you can simply open the debug panel. Use the Agent mode to follow along. Click on the three dots in the top right corner of the chat panel and select "Show chat debug view".
Show chat debug info
When you type a simple request like:
Write a function that sums two numbers.
The panel will show the list of interactions between Copilot and the model. In my case, 5 interactions were needed:
panel/editAgentread_filepanel/editAgentapply_patchpanel/editAgent
While panel/editAgent contains the actual prompt sent to the model and the response (in the form of a diff to apply to the code), the other interactions are tools that Copilot called to gather more context (read_file) or perform actions (apply_patch).
Here are some excerpts from the actual prompts sent to the model:
You are an expert AI programming assistant, working with a user in the VS Code editor.
When asked for your name, you must respond with "GitHub Copilot".
[...]
You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.
[...]
Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.
[...]
Think like a software engineer - when relevant, prefer to:
- Building with GitHub Copilot
From Autocomplete to Autonomous AgentsEnroll now to unlock all content and receive all future updates for free.

