Cursor startup writes unchanged .py file (mtime updates)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Environment

OS: Windows 10/11
Cursor: 3.5.17
File: C:\work\VBA_Python\Workspace\venv\code\create_master_mawm.py (25,911 bytes)
Problem On Cursor launch (no user edit, no manual open), LastWriteTime updates. File hash and size stay the same.

Settings tried (no fix)

files.autoSave: off
editor.formatOnSave: off
files.hotExit: off
window.restoreWindows: none
window.reopenFolders: none
–disable-extensions: still reproduces
Procmon (startup only, ~2s after launch) Cursor.exe:

ReadFile 25,911 bytes
CreateFile Generic Read/Write
SetEndOfFileInformationFile EndOfFile: 0
WriteFile 25,911 bytes
LastWriteTime updates
Defender (MsMpEng / MpDlpService / MsSense) only read; no WriteFile.

Not reproduced on exit — no file access on close after files.hotExit: off.

Expected: Opening/launching Cursor should not write unchanged files.
Actual: Identical content rewritten; mtime changes every launch.

(Procmon CSV excerpt can be attached)

Steps to Reproduce

  1. Windows 10/11, Cursor 3.5.17 (x64).
  2. In User settings.json set:
    files.autoSave: off
    editor.formatOnSave: off (unchecked)
    files.hotExit: off
    window.restoreWindows: none
    window.reopenFolders: none
  3. Close all Cursor windows completely.
  4. In Explorer or PowerShell, note LastWriteTime of:
    C:\work\VBA_Python\Workspace\venv\code\create_master_mawm.py
    (Optional: note SHA256 hash and file size — they stay the same.)
  5. Launch Cursor only (do not open a folder or file; empty workbench).
  6. Wait ~5 seconds without clicking anything.
  7. Check LastWriteTime again → it changes to the current time.
  8. (Optional) Run Process Monitor filtered to that file path:
    Cursor.exe performs ReadFile (25911 bytes), then SetEndOfFile (0),
    then WriteFile (25911 bytes). Defender processes only read.
  9. Close Cursor → LastWriteTime does NOT change (with files.hotExit: off).

Expected Behavior

When Cursor starts (or when no file is opened and the user has not edited anything), Cursor should only read project files if needed. It must not write to source files on disk.

Specifically, create_master_mawm.py should keep its LastWriteTime unless the user explicitly saves or the file content actually changes.

Screenshots / Screen Recordings

Process_Monitor.CSV (17.1 KB)

Operating System

Windows 10/11

Version Information

Version: 3.5.17 (user setup)
VSCode Version: 1.105.1
Commit: d5b2fc092e16007956c9e5047f76097b9e626ca0
Date: 2026-05-20T02:43:31.559Z
Layout: glass
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

No - Cursor works, but with this issue

This is a known bug. Cursor’s internal session restoration rewrites files on startup even when content hasn’t changed, which updates the file timestamp. Your Procmon trace confirms the exact behavior we’re seeing on the engineering side.

Our team is aware of this and it’s being tracked. No fix has shipped yet, but it’s on the radar.

In the meantime, if the rewritten files show up as modified in git, you can clear them with git checkout -- <file> or by discarding changes in the Source Control panel. The file content itself isn’t changing, so discarding is safe.

Thank you for your response. I will wait for the revisions.