skip to content

In VS Code, a team's /write-tests prompt file works in Local agent sessions but is missing from Copilot sessions — why, and how do you migrate it?

level: seniorimportance: nice to knowfreq 4%

answer

  1. two places an agent can run
  2. extension host versus Agent Host
  3. deprecated for Agent Host sessions
  4. Migrate Prompt Files, Convert to Skills
  5. a skill the model may load itself

basics

~20 s

Copilot sessions run in VS Code's Agent Host, which does not load prompt files; only the Local agent still does, and it will be removed. Convert the file to an agent skill with Migrate Prompt Files in the Agent Customizations editor.

solid answer

~50 s

The **Copilot** session target runs in the **Agent Host**, a dedicated process. VS Code's docs say prompt files are deprecated for Agent Host sessions and aren't loaded there. They still work with the **Local** agent, which runs in the extension host, but VS Code says the Local agent will be removed in a future release, and `chat.promptFilesLocations` is deprecated with it. The fix is to convert the prompt file to an **agent skill**. In the Chat view, select the Agent Host, open **Configure Chat** (the Agent Customizations editor), find **Migrate Prompt Files** on the **Overview** tab and choose **Convert to Skills...**. This experimental migration is on by default (`chat.customizations.promptMigration.enabled`). Afterwards, review frontmatter that skills don't support, decide whether to delete the originals (kept copies don't stay in sync), and set `disable-model-invocation: true` if the skill should still run only when someone types `/write-tests`.

code

markdown · 10 lines
markdown
---
name: write-tests
description: 'Write unit tests for the selected code with the project test framework. Use when asked to add or extend unit tests.'
argument-hint: 'function or file to test'
disable-model-invocation: true
---
Write unit tests with the test framework this project already uses.
Match the style of the existing tests next to the code under test.

Run the new tests and fix any failure before you finish.

go deeper

for a junior

Recall that prompt files load only in Local agent sessions, and that the Copilot session target runs in the Agent Host, which does not load them.

for a middle

Explain the Local and Agent Host split, the deprecated chat.promptFilesLocations setting, and the Migrate Prompt Files to Convert to Skills flow.

for a senior

Run the migration with judgment: check unsupported frontmatter, fix skill names that fail silently, set disable-model-invocation where a command must stay manual, and retire the originals.

for a principal

Plan the team's move off the Local agent before its removal, trading the work of converting a prompt library for skills that also serve Copilot CLI and the cloud agent.

## Why the command disappears VS Code can run a chat session in two places, and the **session target** picks which: | Session target | Where it runs | Loads `.prompt.md` files? | |---|---|---| | **Local** | VS Code's extension host on your machine | Yes, from `.github/prompts` and your profile | | **Copilot** | The **Agent Host**, a dedicated process for agent sessions | No: prompt files are deprecated for Agent Host sessions | The **Agent Host** is a separate process that owns agent sessions independently of the window that shows them. That is what lets a session keep running with no window open, be shared across windows, or run on a remote host. It reads customizations from harness-agnostic folders and formats, and VS Code's docs say plainly that prompt files "are deprecated for Agent Host sessions and aren't loaded by Agent Host. They continue to work with the Local agent for now, but the Local agent will be removed in a future release." So `/write-tests` works when a developer picks **Local** and is missing when they pick **Copilot**. Nothing is wrong with the file. ## What is deprecated alongside it - `chat.promptFilesLocations` (default `{ ".github/prompts": true }`) configures prompt file locations for the Local agent only. It is marked deprecated and will go away with the Local agent. - The other Local-only location settings (for instructions, agents and skills) are deprecated for the same reason, because Agent Host sessions don't use them. - GitHub's documentation still labels prompt files a public preview. For VS Code, VS Code's own page is the current word. ## Migrating to an agent skill An **agent skill** is a folder with a `SKILL.md` file. Project skills live in `.github/skills/` (VS Code reads two other project folders as well), and skills also show up as `/` commands. VS Code provides an experimental migration: 1. In the Chat view, select the Agent Host session target that should use the skills. 2. Select **Configure Chat** (gear icon) to open the Agent Customizations editor (Preview). 3. On the **Overview** tab, find **Migrate Prompt Files** and select **Convert to Skills...**. 4. Pick the prompt files. You can open each one to review it first. 5. Confirm, and choose whether to delete the original prompt files. The migration card appears only when an Agent Host is selected and VS Code finds prompt files to migrate. It is controlled by `chat.customizations.promptMigration.enabled`, which defaults to `true`. ## What to review afterwards - **Unsupported frontmatter.** A skill's header has `name`, `description`, `argument-hint`, `user-invocable`, `disable-model-invocation` and `context`, and no `agent`, `model` or `tools` field. VS Code asks you to review migrated skills that used prompt file properties skills don't support. - **Naming.** A skill's `name` may contain only lowercase letters, numbers and hyphens, must match its folder name, and has a 64-character limit. An invalid name makes the skill silently fail to load. - **Who can start it.** A prompt file runs only when invoked. A skill, by default, is both in the `/` menu (`user-invocable: true`) and loadable by the agent on its own when relevant (`disable-model-invocation: false`). Set `disable-model-invocation: true` to keep `/write-tests` on demand only. - **Duplicates.** If you keep the original prompt files, they and the skills do not stay synchronized, so an edit to one is not reflected in the other. ## Checking the result After the migration, confirm that it actually worked rather than assuming it did: 1. Start a session with the **Copilot** session target and type `/`. The migrated `/write-tests` should be listed, now as a skill. 2. Type `/skills` to open the **Configure Skills** menu and confirm where the skill was written. 3. Read its `description`. It is required, can be up to 1024 characters, and should say both what the skill does and when to use it, because that text is what the agent matches when it decides to load a skill on its own. 4. If the skill is missing, check its `name` first, since an invalid name fails silently. ## The payoff Skills are portable. VS Code's docs list Copilot in VS Code, Copilot CLI, the Copilot cloud agent and others as skills-compatible, so the same `.github/skills/write-tests/SKILL.md` can serve several Copilot surfaces. A prompt file only ever served the editor's Local agent.

  • Why does a migrated skill sometimes run when nobody typed its / command?
    A skill's `disable-model-invocation` defaults to `false`, so the agent may load it on its own when its `description` matches the task. A prompt file never ran unless invoked. Set `disable-model-invocation: true` to keep the old on-demand behaviour.
  • Why does the Migrate Prompt Files card not appear for a developer?
    VS Code shows a migration card only when an Agent Host session target is selected and it finds prompt files to migrate, and `chat.customizations.promptMigration.enabled` must be on. It defaults to `true`, so check the selected session target first.

  • The Copilot session target reads .github/prompts just like the Local agent does.
  • Pointing chat.promptFilesLocations at another folder makes Agent Host load prompt files.
  • Migration turns a prompt file into a custom instructions file applied to every request.
  • A migrated skill keeps the prompt file's agent, model and tools fields working.
  • Keeping the original prompt files keeps them synchronized with the new skills.

Assumes VS Code's documentation fetched 2026-10-04 (pages approved 9/30/2026), which marks prompt files deprecated for Agent Host sessions and the Local agent as due for removal.