Skip to content

Feature Request: Agent mode should support working across multiple workspace folders simultaneously #318936

Open

Description

Problem

When using agent mode in a multi-root workspace (or a workspace with multiple folders), the agent is effectively limited to operating within a single folder context. It cannot reason about, navigate, or make changes across multiple repositories/folders in the same session.

This is a significant limitation for developers working on projects that span multiple repositories — for example, a frontend app + backend API, a monorepo with multiple packages, or microservices that need coordinated changes.

Current behavior

  • Agent mode (the new dedicated agents window) scopes its understanding and actions to a single workspace folder
  • There is no way to instruct the agent to "work across repo A and repo B" in a single session
  • In contrast, the Copilot Chat panel in the normal editor view works fine with multi-root workspaces — it can see and reference files across all folders in the workspace

Expected behavior

Agent mode should be able to:

  1. Understand code across all folders in a multi-root workspace, matching the behavior already available in the normal Chat panel
  2. Read and edit files across multiple workspace folders in a single agent session
  3. Maintain context about how code in one folder relates to code in another (e.g., API contracts, shared types, service boundaries)

Use cases

  • Coordinating API changes between a backend and frontend repo
  • Refactoring shared types/interfaces across multiple packages in a workspace
  • Making changes that span service boundaries in a microservices architecture
  • Reviewing or understanding cross-repo dependencies

Current workarounds

  • Opening separate VS Code windows (one per repo) with independent agent sessions — loses cross-repo context
  • Using CLI-based AI tools that can operate across directories

Environment

  • VS Code Version: 1.122.0
  • OS: Windows 11

Activity

  1. vs-code-engineering commented on May 29, 2026

    @vs-code-engineering
    Contributor

    Thanks for creating this issue! It looks like you may be using an old version of VS Code; the latest stable release is 1.122.1. Please try upgrading to the latest version and checking whether this issue remains.

    Happy Coding!

  2. tdekelver-bd commented on May 29, 2026

    @tdekelver-bd
    Author

    Still experiencing this limitation on VS Code 1.122.1 — agent mode remains scoped to a single folder in multi-root workspaces.

  3. johnmarksilly commented on Jun 4, 2026

    @johnmarksilly

    Would also like this. We use multi root instead of mono-repos.

    Ideally all behavior with the project mirrors the normal VS code view, whether it spans multiple roots or not.

  4. added
    feature-request
    on Jun 5, 2026
  5. vs-code-engineering commented on Jun 5, 2026

    @vs-code-engineering
    Contributor

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  6. vs-code-engineering commented on Jul 4, 2026

    @vs-code-engineering
    Contributor

    🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  7. JohnGalt1717 commented on Jul 15, 2026

    @JohnGalt1717

    For us we have a mono-repro. It has multiple apps (flutter) and has a C# api.

    In that there is a root .agents folder. This is the governance for the entire monorepro so we don't have to repeat ourselves. The root of the repro isn't loaded when working on any of the apps or the API because then it would see all of the rest and cause VS code to get slow.

    In this we have agents.md, routing.md, and shared skills in a skills folder.

    And then in ./Api we have an other .agents folder with agents.md, routing.md and shared skills for .net and our api.

    And in ./Apps we have another .agents folder with agents.md, routing.md and shared skills for all of our flutter apps.

    And each app, has a .agents folder with the same.

    The apps and api use workspace files. Apps specifically open the App's folder, plus our shared library and our api library as folders in the workspace so that vs code doesn't get distracted by the other apps.

    At every one of those levels we also have a .mcp.json (although I really wish the standard was to put mcp.json in .agents/)

    What I would expect VS Code to do is:

    1. Start at the root of repro and find ./.agents and load everything in there and find the root .mcp.json and load that in.
    2. Walk up. So if an App workspace (which the workspace file lives in the Apps folder), find the on in /Apps for .agents/ and .mcp.json and load those.
    3. Look in all loaded folders under App and load those. (and Api would just have the single folder with the workspace file being in the root of the repo and opening ./Api so the logic holds)

    This would allow us to never repeat ourselves, only load mcps that are relevant to the workspace loaded, and share the code nicely.

    A setting on the workspace file for "Allow repository agent instructions" or similar would solve this if the above logic was followed.

    And this wouldn't cause security issues because it's already working on the entire repo.

    There's already a setting that allows skills to do exactly this, although I'm not sure that it works right on multi-folder workspaces loading all of the folders in the workspace AND everything above every one of those, but it should be expanded.

  8. ayeltsov commented on Oct 1, 2026

    @ayeltsov

    This is the reason I'm unable to use Copilot harness in VS Code - I always use workspaces with multiple roots, and I rely on instructions from them to be auto-discoverable. So sticking with VS Code Local harness until this is implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

agents-windowagents-window-parityfeature-request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions