Skip to content

Support multi-root workspaces via .code-workspace file for additional folder context and instruction files #1826

Description

@boazwasserman

Describe the feature or problem you'd like to solve

When using the Copilot CLI connected to a VS Code IDE workspace (via /ide), the CLI does not read the .code-workspace file to discover additional root folders. This means: 1. Instruction files (e.g., AGENTS.md) in additional workspace folders are not discovered or loaded 2. File context from additional workspace folders is not available for search/indexing — the agent only sees the primary cwd/git-root 3. Workspace settings like github.copilot.chat.codeGeneration.instructions that reference files in additional folders are not applied The VS Code extension handles this correctly — it reads all root folders from the .code-workspace file and includes their context and instruction files. Example Given this productivity.code-workspace: { "folders": [ { "path": "." }, { "path": "../../repos/TeamCerebro" }, { "path": "../../../../projects/XSPM-PostureEffectivenessScore" } ], "settings": { "github.copilot.chat.codeGeneration.instructions": [ { "file": "AGENTS.md" } ] } } The VS Code Copilot Chat extension indexes all 3 folders and loads the AGENTS.md instruction file. The CLI only sees the primary folder (cwd).

Proposed solution

When connected to a VS Code IDE workspace via /ide:

  1. Read the .code-workspace file to discover all root folders
  2. Include instruction files from all workspace roots (respecting the same discovery rules: AGENTS.md, .github/copilot-instructions.md, etc.)
  3. Make all workspace folders available for file search/context (same as the extension does)

Alternatively, support a CLI flag or config option like --workspace <path-to-.code-workspace> for standalone use without /ide.

Example prompts or workflows

The agent can manually read the .code-workspace file, resolve the relative paths, and access the additional folders — but this requires explicit manual navigation rather than automatic discovery

Additional context

Activity

  1. added
    area:context-memory
    on Apr 6, 2026
  2. added
    area:configuration
    on Apr 6, 2026
  3. andyleejordan commented on Apr 14, 2026

    @andyleejordan

    This would be great, I was just looking for a way to do this as the PowerShell Extension for VS Code is a multi-root workspace (the server and client are separate repos but of course work in tandem), and am struggling to get Copilot CLI to understand them both simultaneously.

  4. ayeltsov commented on May 14, 2026

    @ayeltsov

    This is an adoption blocker for me.

    I organized my work around 2 workspaces: the main repo/workspace (where the work is performed) and auxiliary repo/workspace that has my specific instructions and skills. I store this auxiliary repo on OneDrive, making it auto-synched on all machines I work on - it's very convenient to have my setup travel with me.

  5. ermse commented on May 27, 2026

    @ermse

    I frequently ask agents to work across multiple repos scattered in different places on the disk, so I adopted vscode workspace files as a sort of directory based replacement for Visual Studio IDE *.slnx files. Quickly and visually giving the agent needed context.
    IMHO vscode workspaces is a killer feature of vscode copilot chat.

    I would also consider adding some sort of guid into workspace file, so copilot can restore all workspace related sessions if I move the workspace somewhere, or clone repo with it in another vm.

    Codex does not have anything similar yet..
    Adding that support into copilot cli would be great. This is what codex said:

    Q:

    tell me what should I know about the Project concept in codex. How it is different from vscode workspace. I used to work with copilot in a mutli-root workspace where it combines instructions and skills from all roots. Can I get similar experience with projects?

    A

    Short version: Codex Projects are not VS Code multi-root workspaces. A Codex project is closer to an agent execution context: current working directory, project/root discovery, trust, sandbox permissions, AGENTS.md guidance, repo skills, and project-local .codex config.

    The big difference: Codex does not appear to automatically merge instructions and skills from every folder in a VS Code .code-workspace. Official docs say Codex builds guidance from:

    global ~/.codex/AGENTS.md
    then AGENTS.md files from the project root, usually the Git root, down to the current working directory
    later, closer files override earlier guidance
    Source: AGENTS.md discovery
    Skills work similarly but with their own discovery path: Codex reads repo skills from .agents/skills from your current working directory up to the repo root, plus user/admin/system skills. Source: Agent Skills

    So for your old Copilot setup:

    What you can get:

    Multi-repo file access/editing: yes, via permission profiles or workspace roots.
    Shared instructions across repos: yes, put them in ~/.codex/AGENTS.md, or in a shared parent/umbrella project where appropriate.
    Shared skills across repos: yes, put them in $HOME/.agents/skills, package them as a plugin, or symlink/duplicate repo skills.
    Project-specific instructions: yes, use AGENTS.md in each repo or subdirectory.
    Project-specific config: yes, .codex/config.toml, but only after the project is trusted. Source: config reference
    What you probably do not get as a direct equivalent:

    “Open one multi-root workspace and automatically combine all root instructions/skills” as a first-class Codex behavior.
    Sibling repo AGENTS.md / .agents/skills files merged just because they are all part of some workspace.
    The closest Codex pattern is: create a shared permission profile that grants access to all related roots, keep cross-cutting behavior in global AGENTS.md / global skills, and keep repo-local rules inside each repo.

  6. jmeza96-not-an-llm commented on Jul 17, 2026

    @jmeza96-not-an-llm

    I need this feature 🙏

  7. Kreynar commented on Nov 18, 2026

    @Kreynar

    This is an adoption blocker for me.

    I organized my work around 2 workspaces: the main repo/workspace (where the work is performed) and auxiliary repo/workspace that has my specific instructions and skills.

    It's the same in my case as well.
    It worked perfectly with "Local" harness and it's the biggest issue switching to "Copilot".

    I believe, this setup may be quite common among developers. Many may be affected by the issue, just simply not be aware of it. Because e.g. skills seem to get loaded successfully, but copilot-instructions.md not.

    As a workaround on my second repo I've renamed copilot-instructions.md to general.instructions.md. Then moved it under instructions/. And in workspace file added:

    "chat.instructionsFilesLocations": {
      "<pathToMySecondRepository>/.github/": true,
    }
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationarea:context-memory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions