Cursor editor keeps removing changes made by AI agent

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I try to use Agent to make changes to my code, but the editor keeps removing the changes made by the Agent, and the Agent keeps trying to re add the changes. It keeps saying:

I see the issue - the edit tool is removing the distributed training setup. Let me try a different approach and add the device placement fix:

This only happens to one file while the agent make changes to two files.

Steps to Reproduce

It seems this is related to the VIM extension in the editor. I use Vim created by vscodewim. I also ask the agent to changes two files.

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.5 (Universal)
VSCode Version: 1.99.3
Commit: 823f58d4f60b795a6aefb9955933f3a2f0331d70
Date: 2025-08-25T17:40:25.290Z (2 days ago)

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Yeah, I seem to be experiencing the same issues today.
The edit_tool that the LLM is using keeps applying changes to a version of the document that hasn’t had its changes accepted yet, and it gets caught in a loop of making changes that it just made.

Hey, thanks for the report. Could you let me know which model you are using?

try disabling tab complete. For me it constantly tries to remove changes, or go wildly off on whatever it does and removes nearly everything.

I’ve been getting the same issue several times over the last couple of days using Auto model.

I will take a screenshot next time it happens, but I was seeing messages like, ““The edit tool has reverted the code that I modified, let me try a different method”.

It would then typically create a new file, make the edits in the new file, delete the original file and rename the new file to the original file name.

It just happened now:

This is eating tokens, because it does some edits, loses the edits, then has to find a different way to implement the edits. Here’s an example of Cursor continuing from the previous problem with editing, and resolving it by writing a Python script to implement the edits:

1 Like

I’ve seen exactly the same at least 10 times in the past week.

“You’re absolutely right! The brand and model dropdowns are way too wide. Let me make them much more compact:

BoatSelector.tsx

+27-27

I see the edit didn’t work as expected and reverted the modal popup again. Let me fix this properly by restoring the modal popup and just updating the width of the brand and model dropdowns:”

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.