VS Code Copilot parent repo

When only a subdirectory of a Git repository is opened in Visual Studio Code, repo-root Copilot customizations like .github/copilot-instructions.md are not discovered by default. This can make Copilot ignore repository-wide instructions even though they exist at the top of the current Git repository.

Visual Studio Code has a built-in configuration items to resolve this issue by enabling parent repository discovery for chat customizations.

{
  "chat.useCustomizationsInParentRepositories": true
}

With this setting enabled true, VS Code walks upward from the opened workspace folder until it finds .git. It then discovers chat customizations between the opened folder and the repository root, including:

  • .github/copilot-instructions.md
  • .github/instructions/*.instructions.md
  • prompt files
  • agent files such as AGENTS.md
  • hooks and other chat customizations

This setting is especially useful for monorepos and for workflows that open a focused subdirectory such as content/posts/, src/, or packages/frontend/ instead of the full repository root. Without parent repository discovery, Copilot can miss repository-specific style and validation rules.

A few conditions apply:

  • the opened folder must not itself be a separate Git repository (e.g. Git submodule)
  • a parent folder must contain .git
  • the parent repository folder must be trusted in VS Code

To verify that the repository instructions are in use, inspect the References list on a Copilot Chat response. If parent discovery is working, the response references typically include the repo-root customization files.