Simon Willison’s Weblog: microsoft/vscode-copilot-chat

Source URL: https://simonwillison.net/2025/Jun/30/vscode-copilot-chat/#atom-everything
Source: Simon Willison’s Weblog
Title: microsoft/vscode-copilot-chat

Feedly Summary: microsoft/vscode-copilot-chat
As promised at Build 2025 in May, Microsoft have released the GitHub Copilot Chat client for VS Code under an open source (MIT) license.
So far this is just the extension that provides the chat component of Copilot, but the launch announcement promises that Copilot autocomplete will be coming in the near future:

Next, we will carefully refactor the relevant components of the extension into VS Code core. The original GitHub Copilot extension that provides inline completions remains closed source — but in the following months we plan to have that functionality be provided by the open sourced GitHub Copilot Chat extension.

I’ve started spelunking around looking for the all-important prompts. So far the most interesting I’ve found are in prompts/node/agent/agentInstructions.tsx, with a block that starts like this:

You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks. The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user’s question.

There are tool use instructions – some edited highlights from those:

When using the ReadFile tool, prefer reading a large section over calling the ReadFile tool many times in sequence. You can also think of all the pieces you may be interested in and read them in parallel. Read large enough context to ensure you get what you need.
You can use the FindTextInFiles to get an overview of a file by searching for a string within that one file, instead of using ReadFile many times.
Don’t call the RunInTerminal tool multiple times in parallel. Instead, run one command and wait for the output before running the next command.
After you have performed the user’s task, if the user corrected something you did, expressed a coding preference, or communicated a fact that you need to remember, use the UpdateUserPreferences tool to save their preferences.
NEVER try to edit a file by running terminal commands unless the user specifically asks for it.
Use the ReplaceString tool to replace a string in a file, but only if you are sure that the string is unique enough to not cause any issues. You can use this tool multiple times per file.

That file also has separate CodesearchModeInstructions, as well as a SweBenchAgentPrompt class with a comment saying that it is “used for some evals with swebench".
Elsewhere in the code, prompt/node/summarizer.ts illustrates one of their approaches to Context Summarization, with a prompt that looks like this:

You are an expert at summarizing chat conversations.
You will be provided:
– A series of user/assistant message pairs in chronological order
– A final user message indicating the user’s intent.
[…]
Structure your summary using the following format:
TITLE: A brief title for the summary
USER INTENT: The user’s goal or intent for the conversation
TASK DESCRIPTION: Main technical goals and user requirements
EXISTING: What has already been accomplished. Include file paths and other direct references.
PENDING: What still needs to be done. Include file paths and other direct references.
CODE STATE: A list of all files discussed or modified. Provide code snippets or diffs that illustrate important context.
RELEVANT CODE/DOCUMENTATION SNIPPETS: Key code or documentation snippets from referenced files or discussions.
OTHER NOTES: Any additional context or information that may be relevant.

prompts/node/panel/terminalQuickFix.tsx looks interesting too, with prompts to help user’s fix problems they are having in the terminal:

You are a programmer who specializes in using the command line. Your task is to help the user fix a command that was run in the terminal by providing a list of fixed command suggestions. Carefully consider the command line, output and current working directory in your response. […]

That file also has a PythonModuleError prompt:

Follow these guidelines for python:
– NEVER recommend using "pip install" directly, always recommend "python -m pip install"
– The following are pypi modules: ruff, pylint, black, autopep8, etc
– If the error is module not found, recommend installing the module using "python -m pip install" command.
– If activate is not available create an environment using "python -m venv .venv".

There’s so much more to explore in here. xtab/common/promptCrafting.ts looks like it may be part of the code that’s intended to replace Copilot autocomplete, for example.
Via @ashtom
Tags: github, microsoft, open-source, ai, prompt-engineering, generative-ai, github-copilot, llms, vs-code, llm-tool-use, coding-agents

AI Summary and Description: Yes

Summary: The text discusses the release of the GitHub Copilot Chat client for VS Code under an open-source license, outlining its features and functionalities that support coding tasks. This represents a significant development in the realm of AI-powered coding assistants, highlighting the integration of various tools for improving user experience and task automation.

Detailed Description: The text provides an insight into Microsoft’s GitHub Copilot Chat client aimed at enhancing the coding experience within VS Code. This development is notable for security and compliance professionals as it involves open-source elements, AI tool use, and instructions that may necessitate attention in terms of security practices.

– **Overview of GitHub Copilot Chat**:
– Released at Build 2025 and made available under an MIT open-source license.
– Currently includes the chat functionality, with plans to incorporate autocompletion features from the closed-source GitHub Copilot extension.

– **Key Functionalities and Instructions**:
– Describes several tool use instructions within the Copilot Chat extension which guide user interactions effectively.
– **Tool Instructions**:
– Utilize ReadFile effectively by preferring larger reads over multiple small reads.
– Use FindTextInFiles for file overviews instead of multiple calls to ReadFile.
– Avoid parallel execution of commands in the terminal.
– UpdateUserPreferences to remember user corrections and preferences.
– ReplaceString tool to alter strings only when certain of their uniqueness to avoid conflicts.

– **Context Summarization Approach**:
– A clear structure for summarizing conversations with users was highlighted.
– Ensures understanding of user intent, task requirements, and existing work.
– Provides detailed paths and code snippets for clarity.

– **Specific Commands and Guidelines**:
– Terminal prompts for helping users fix command issues.
– Instructions on handling Python module errors, emphasizing best practices instead of directly recommending certain commands.

– **Further Exploration**:
– Other files within the client are mentioned as potentially relevant for future developments, particularly in prompt crafting which may evolve the functionality of Copilot’s autocomplete features.

In summary, the text highlights critical developments in AI-assisted coding tools, including best practices for using such tools responsibly. For security professionals, understanding these interactions, tool usages, and potential vulnerabilities is key in ensuring an efficient and secure integration of AI into coding workflows.