AI code changes immediately revert on specific files

Hey, thanks for the report.

These symptoms (changes instantly reverting plus extra indentation showing up) usually point to one of two causes:

  1. Cloud sync - OneDrive, Dropbox, or Google Drive may be overwriting files with older versions faster than Cursor can save them. We recently solved a similar case (File keeps reverting and losing all my work) and the cause was OneDrive.

  2. Formatting extensions - if Format On Save is enabled plus Prettier, Black, or ESLint, they can conflict with AI edits.

Can you check:

  • Is iCloud Drive or any other sync running for these files?
  • Which formatting extensions are installed? (Prettier, ESLint, etc.)
  • Is Settings > Format On Save enabled?
  • What file types are affected? (Python, JS, something else?)

For a quick extension check, try running cursor --disable-extensions, open the problem file, and repeat the AI edit. If the issue goes away, the cause is an extension.