Can VS Code extensions contribute Copilot chat modes, prompts, and instructions without workspace files?
Extension authors want to ship a custom Copilot chat mode (for example a "Testing" mode) with its own base prompt, tool list, and MCP integration, without making users add files to their workspace or commit them to version control. Is this possible from the extension manifest in VS Code, and which contribution points or API cover modes, prompts, and instructions?
Originally asked on GitHub: https://github.com/microsoft/vscode/issues/251580
2 answers
Status: fixed. The
chatPromptFilesandchatInstructionscontribution points were added and are available in VS Code 1.105;chatModesis exposed only as proposed API for now.A maintainer added these contribution points in response to this request. Extensions can now contribute prompt and instruction files from the extension manifest, so custom chat content no longer has to live in the user's workspace or be committed to version control.
chatModesis proposed API for now because the team is still figuring out how the modes should scale in the UI. In current VS Code Insiders builds, the feature has been renamed from "custom chat modes" to "custom agents."One user tried a
whencondition on achatAgentscontribution to register different agents depending on the active model (for example Claude Sonnet vs. GPT) and reported the condition isn't honored. The maintainer explained that VS Code doesn't have context keys for the active language model, and that a user can switch models after selecting an agent. The suggested approach is to set themodelattribute in the agent header instead, so the agent itself defines which model it runs with.Did this work for you?What @saragluna tried on GitHub (Didn't work)
Tried registering two agents in the
chatAgentscontribution with awhencondition (one for Claude Sonnet, one for GPT), expecting the active model to decide which agent appears. The condition is not honored by the contribution point.Source: https://github.com/microsoft/vscode/issues/251580#issuecomment-3435852869 (opens external site)
Did this work for you?