[Feature Request] Allow configuring Copilot agent/skill/instruction discovery paths via settings

Open
#322,506 0 comments 0 reactions 2 assignees View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

Currently, VS Code has two separate systems for discovering Copilot agent files:

Workbench-side (.agent.md files): Already configurable via the chat.agent.fileLocations setting.
Agent host-side (Copilot SDK session discovery in sessionCustomizationDiscovery.ts): Paths are hardcoded and cannot be customized.
The agent host side scans a fixed set of directories for agents, skills, and instruction files:

Workspace:

.github/agents, .agents/agents, .claude/agents (agents)
.github/skills, .agents/skills, .claude/skills (skills)
.github/instructions (instructions)
User home:

.copilot/agents (agents)
.agents/skills (skills)
.copilot/instructions (instructions)
Instruction files (AGENTS.md, CLAUDE.md, GEMINI.md, etc.) are also discovered from hardcoded paths.

Problem
Teams and individuals who organize their repositories differently (e.g., monorepos, custom tooling conventions, or non-standard directory layouts) cannot point the agent host discovery to their preferred locations. There is no escape hatch — the only option is to restructure the repository to match the hardcoded paths.

In contrast, the workbench-side already demonstrates that this is solvable: PromptsConfig.AGENTS_LOCATION_KEY allows users to specify custom paths for .agent.md files via settings. The agent host side lacks an equivalent mechanism.

Proposed Solution
Expose the agent host searchRoots (and optionally agentInstructions) as a VS Code setting, similar to how chat.agent.fileLocations works for the workbench side. For example:

// settings.json
"chat.agent.hostDiscoveryPaths": {
"workspace": {
"agents": [".github/agents", "my-team/agents"],
"skills": [".github/skills"],
"instructions": [".github/instructions"]
},
"user": {
"agents": ["/.copilot/agents", "/.my-org/agents"]
}
}
The setting should:

Accept relative paths (resolved from workspace root) and ~/-prefixed paths (resolved from user home).
Default to the current hardcoded values so existing behavior is preserved.
Be marked as restricted: true (workspace trust) consistent with the existing chat.agent.fileLocations setting.
Relevant Code
Hardcoded discovery: src/vs/platform/agentHost/node/copilot/sessionCustomizationDiscovery.ts (searchRoots, agentInstructions)
Configurable workbench-side equivalent: src/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations.ts (DEFAULT_AGENT_SOURCE_FOLDERS)
Setting registration: src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts (AGENTS_LOCATION_KEY)
Use Cases
Monorepos where agents live in a subdirectory (e.g., packages/ai-tools/agents)
Organizations with a shared agents directory outside the standard .github/ convention
Users who want to keep agent files alongside their dotfiles in a non-default home directory path

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.