I had a similar issue. I wanted Cursor to stop using old data on a project I wanted to start over but did not want to start over with a new agent.
FIrst project was in one folder, I moved project to a new folder and deleted the old.
This caused Powershell and a few other grep commands to fail.
Fix below:
Fix Cursor when an agent is stuck on an old project folder
Suppose Cursor is still tied to:
C:\Path\To\Old Project Folder
but the real project now lives at:
C:\Path\To\New Project Folder
The clean workaround is to replace the old folder path with a junction that points to the new folder. Cursor can keep using the old path, but all reads and writes go to the new project.
First, rename the old folder so nothing is lost:
ren "C:\Path\To\Old Project Folder" "Old Project Folder BACKUP"
Then create the junction from PowerShell:
cmd /c mklink /J "C:\Path\To\Old Project Folder" "C:\Path\To\New Project Folder"
Expected result:
Junction created for C:\Path\To\Old Project Folder <<===>> C:\Path\To\New Project Folder
Verify it:
Get-Item "C:\Path\To\Old Project Folder" | Format-List FullName,LinkType,Target
You should see:
LinkType : Junction
Target : {C:\Path\To\New Project Folder}
After that, reopen Cursor using the old path. The agent should continue working normally, while the actual files remain in the new folder.
Once you confirm everything works, the renamed backup can be removed:
Remove-Item "C:\Path\To\Old Project Folder BACKUP" -Recurse -Force
To remove only the junction later without deleting the real project:
cmd /c rmdir "C:\Path\To\Old Project Folder"
Important: create the junction only after the original old-path folder has been renamed or removed. A junction cannot be created where a normal folder already exists.