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.
Ask the AI agent to edit a file in the first folder (foo-qa)
Observe the error: Error: Invalid arguments
Ask the AI agent to edit a file in the second folder (foo)
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)
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.
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.
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