Per-agent working root in multi-root workspaces (do not default every chat to folder #1)

Feature request for product/service

Cursor IDE

Describe the request

In a multi-root .code-workspace, every new agent chat is rooted in the first folder. There is no way to pick which repo a chat starts in. working_directory on the Shell tool is a separate, already-tracked bug (158937); even if that is fixed, the session default would still be folder #1 unless the user reorders the workspace file or opens a single-folder window.

Please add an explicit agent working root for each chat:

  1. A picker when starting a chat in a multi-root workspace (“Work in: rocci | okmate | rocci-app | …”), defaulting to the focused file’s folder or the last used root — not silently folder #1.
  2. Surface that root in the chat header / context (“Workspace path”) so the user can see and change it mid-session.
  3. Use that root as the sandbox default cwd for Shell, git, and related tools. Sibling roots stay readable (and writable, per existing approvals); they just are not the default pwd.
  4. Agents Window: the same “select cwd” folder picker the Editor Window already shows for new terminals (171084). Colin noted terminal.integrated.cwd is ignored there.

CLI already has this split: --workspace is primary, --add-dir adds extra roots (170291). The IDE should expose the same idea in the UI.

Why it matters

Multi-root is the normal setup for sibling products (language repo + app + docs + desktop host). Folder order is an explorer convenience, not a statement of “this chat is about repo A.” Today:

  • Agents run git status / git log in the wrong repo and treat the output as truth.
  • Users burn a turn (or a whole session) on “wait, that was the sibling.”
  • Workarounds (reorder folders, one window per repo, prefix every command with cd /abs &&) either fight the workspace or only help after the agent already guessed wrong.

Related but different: Git Graph also keys off the first folder (163262). A per-chat working root would not fix Graph; it would stop agents from inheriting that same first-folder default.

Suggested UX (minimal)

  • New chat in multi-root: optional “Working root” dropdown (required only if you want to force the choice; auto-detect from focused editor / @folder is enough).
  • Command Palette: Cursor: Set Agent Working Root…
  • Persist last choice per workspace, not globally.

Does this stop you from using Cursor

No — but every multi-root session starts with a silent 50/50 chance the agent is in the wrong git repo.