'invalid arguments' with StrReplace in multifolder workspace

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The Cursor agents are consistently running into ‘invalid arguments’ when using their editing tools, like ‘StrReplace’. Here’s its own analysis of the issue after I worked with it for awhile. It’s making so I can’t use my multifolder workspace to edit files.

The StrReplace and Write editing tools fail with “Invalid arguments” error when attempting to edit files in any workspace folder except one in a multi-root workspace configuration.

Steps to Reproduce

  1. Create a .code-workspace file with multiple folders:
    {
    { “folders”: [ { “path”: “./”, “name”: “foo-qa” }, { “path”: “../foo”, “name”: “foo” } ] }
  2. Ask the AI agent to edit a file in the first folder (foo-qa)
  3. Observe the error: Error: Invalid arguments
  4. Ask the AI agent to edit a file in the second folder (foo)
  5. Observe: Edit succeeds

StrReplace and Write only work on one folder (appears to be selected alphabetically - foo before foo-qa)
Read tool works correctly on all folders
Shell, LS, Glob, Grep tools work correctly on all folders

Expected Behavior

Editing tools should work on files in all workspace folders.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.34
VSCode Version: 1.105.1
Commit: 643ba67cd252e2888e296dd0cf34a0c5d7625b90
Date: 2026-01-10T21:17:10.428Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0

For AI issues: which model did you use?

Opus 4.5, Claude 4.5

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

3 Likes

Hey, thanks for the report. This is a known issue: the agent’s editing tools (StrReplace, Write) don’t work correctly in multi-root workspace setups. The team is aware and is working on a fix.

As a temporary workaround, open each repo as a separate workspace when you need the agent to edit files.

Related multi-root workspace issues:

Your report has been added to help prioritize the fix.

1 Like

Thank you!

Hi, any updates on this issue? The workspace feature is truly essential for multi-project development.

Hey! No updates on this bug yet, it’s been logged.

I get that multi-root workspaces are critical for multi-project setups. Your request helps the team see this is still an active issue.

For now, the workaround is the same: open each repo as its own workspace when you need to make edits via the agent.

I’ll post in the thread if there are any updates on a fix.

I’m experiencing this issue as well, especially when connecting to a Windows machine from a Mac client.
This issue also seems to completely break the diffing functionality. You can’t view, accept/reject changes at all, and undo functionality doesn’t work. The agents resort to having to write shell scripts to edit files inline, and that doesn’t get picked up by Cursor as a file being modified.

I would really appreciate it if you can escalate this issue. Cursor is borderline unusable in multi root workspaces, which I would assume is the majority of Enterprise customers.

Version: 2.4.28
Commit: f3f5cec40024283013878b50c4f9be4002e0b580

I am experiencing this issue as well.

For me The issue also came up when on a single folder workspace, I had cursor check another folder for a specific method ( for context and planning)
even though the second folder/repo was not open as part of the workspace