Cursor silently rewrites a file on every app launch (Undo Create Diff)

Hi Cursor team,

Every time I open Cursor, one source file gets modified on disk within a few seconds — even with no agent running. The change is only junk at EOF (duplicate closing token + blank lines).

git restore + deleting Local History only helps temporarily; on next launch Cursor recreates a Local History entry with "source": "Undo Create Diff" and dirties the file again. Archiving related chats doesn’t stop it.

Is startup supposed to re-apply Create Diff / undo writes to disk? How can I clear that stale state?

Thanks

Hi there!

We detected that this may be a bug report, so we’ve moved your post to the Bug Reports category.

To help us investigate and fix this faster, could you edit your original post to include the details from the template below?

Bug Report Template - Click to expand

Where does the bug appear (feature/product)?

  • Editor, Tab & Chat (autocomplete, Composer, in-editor agent)
  • Terminal & commands
  • Models, pricing & API keys (availability, Auto/Max, BYOK/Bedrock)
  • MCP & tools
  • Cloud Agents & Automations (cursor.com/agents, scheduled/event)
  • BugBot & Code Review
  • Cursor CLI
  • Cursor Mobile
  • Remote (SSH / Dev Containers / WSL)
  • Account, billing & login
  • Something else…

Describe the Bug
A clear and concise description of what the bug is.


Steps to Reproduce
How can you reproduce this bug? We have a much better chance at fixing issues if we can reproduce them!


Expected Behavior
What is meant to happen here that isn’t working correctly?


Screenshots / Screen Recordings
If applicable, attach images or videos (.jpg, .png, .gif, .mp4, .mov)


Operating System

  • Windows 10/11
  • MacOS
  • Linux

Version Information

  • For Cursor IDE: Menu → About Cursor → Copy
  • For Cursor CLI: Run agent about in your terminal
IDE:
Version: 2.xx.x
VSCode Version: 1.105.1
Commit: ......

CLI:
CLI Version 2026.01.17-d239e66

For AI issues: which model did you use?
Model name (e.g., Sonnet 4, Tab…)


For AI issues: add Request ID with privacy disabled
Request ID: f9a7046a-279b-47e5-ab48-6e8dc12daba1
For Background Agent issues, also post the ID: bc-…


Additional Information
Add any other context about the problem here.


Does this stop you from using Cursor?

  • Yes - Cursor is unusable
  • Sometimes - I can sometimes use Cursor
  • No - Cursor works, but with this issue

The more details you provide, the easier it is for us to reproduce and fix the issue. Thanks!

Hey there! Thanks for the detailed writeup. This isn’t something you misconfigured - a stored pending Agent/Composer change for that file is being re-applied on every launch, which is why the junk returns even after git restore. We’ve let the team know and it’s an issue we’re tracking.

To stop the loop:

  1. Open the affected file - you’ll see a pending change / Review entry for it.
  2. Click Keep (or Keep All) on it - not Undo/Reject (Undo rolls back saved code; Keep just clears the overlay).
  3. Start a new chat to reset the Review list.
  4. Run git restore <file> once more - with the stored state cleared, it won’t come back.

Before quitting or updating, Keep or discard any pending edits, then quit with Cmd+Q. If it still recurs after that, reply with your Cursor version and I’ll dig in.

Hi, that worked.

The pending Review was still sitting on an archived Agent chat — Keep there, then a new chat + git restore, and the leftover change is gone.

Thanks.