Cursor keeps re-writing many files in my project for no apparent reason with the same content. I even tried rebooting and it keeps re-writing files, causing Vite frontend restarts even when not editing any files. The agent proposed many solutions and they all failed until it realize it was Cursor itself the process rewriting the files. I asked Cursor if it was worth a forum bug:
What happened
After a long agent chat left many frontend/ files at 0 bytes, you restored them (Local History / History). Cursor’s main process then kept re-writing that same ~100-file set every ~5 minutes with identical content. That wasn’t Vite, a shell script, or task-runner — fatrace showed cursor(<main pid>): W.
Side effects: mid-write empties of vite.config.ts / package.json crashed Vite; a second Vite hit HMR port 24678.
What it wasn’t
Not normal autosave. It continued with no tabs open, and the cadence was ~300s, not the autosave delay. Turning off files.autoSave / hotExit / local history didn’t stop the loop by itself.
Likely cause
Cursor agent/composer checkpoint state (fileStatesV2 / similar) re-materializing the wipe/restore set on a timer — not a project bug.
Workarounds that helped
New agent chat after a multi-file restore
Restore via shell cp, not bulk editor Apply
chattr +i on the rewrite batch when it wouldn’t stop
Worth a forum bug? Yes.
That’s useful for the Cursor team; it’s not a one-off “user misconfigured” issue.
Steps to Reproduce
This is reproducible-ish product behavior with clear symptoms and evidence. Include:
Mass 0-byte wipe → History restore in a long agent chat
Same file set rewritten every ~5 min with no editors open
Hey, thanks for the detailed report. The fatrace attribution and the breakdown are especially helpful.
What you’re describing isn’t intended behavior and it’s not something in your project config. It’s a known issue we’re tracking. If there’s a persisted inline diff from an agent session, Cursor can force-save the whole set of affected files when the window starts. In a non-git workspace like yours with SVN, that state doesn’t clear on its own, so the diff set sticks around and gets written again. Your idea about re-materializing the restore set is basically right. I’ve passed this to the team. I can’t share an ETA yet, but I’ll post here when there’s an update.
What helps keep it under control:
Before you exit Cursor, hit Keep or Reject on all pending agent edits so you don’t leave persisted diffs.
In an SVN workspace, after a big agent session, start a new chat. That helps limit the scope.
Restore overwritten files via the shell using cp or svn revert, not bulk restore in the editor. A big in-editor restore recreates about 100 diffs and restarts the loop.
One thing I want to confirm. loadInlineDiffs normally runs once on window start, but for you the loop repeats about every 5 minutes during the session. That looks like the window or renderer is reloading. If you can grab logs, it’d really help confirm what’s triggering the repeats: Help > Toggle Developer Tools > Console tab, plus main.log around two back-to-back rewrite events. Let me know how it goes.
Thanks, main.log helped. A couple things it shows:
The extension host processes restart about every ~5 minutes throughout the log, and on the same ~5-minute grid there are repeated warnings: RequestStore#acceptReply was called without receiving a matching request. This matches the file rewrite cadence you mentioned.
There are also a couple process crashes: extensionHost crashed with code 133 at 11:04:19, and fileWatcher with code 15 / killed at 14:45:08.
What main.log is still missing is a clear sign of a full window or renderer reload. loadInlineDiffs normally runs once on window start, so seeing it repeat every ~5 minutes more likely points to the window or renderer getting reopened in a loop, but main.log doesn’t show that definitively. Console logs will confirm or rule it out.
So next time you catch the reloading, please grab Help > Toggle Developer Tools > Console around two back-to-back file rewrite events. That should be enough to figure out what’s triggering the repeats.
Until this is under control, the workarounds from the previous message still apply: Keep or Reject all pending edits before exiting, start a new chat after a big agent session in an SVN workspace, and restore via cp or svn revert. I’ll post here when there’s an update.
Here is the console log. I cropped it in the middle to fit the max post size.
workbench.desktop.main.js:450 This document requires 'TrustedScript' assignment. The action has been blocked.
(anonymous) @ workbench.desktop.main.js:450
workbench.desktop.main.js:450 The JavaScript Function constructor does not accept TrustedString arguments. See https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor for more information.
workbench.desktop.main.js:7682 This document requires 'TrustedScript' assignment. The action has been blocked.
(anonymous) @ workbench.desktop.main.js:7682
workbench.desktop.main.js:7682 The JavaScript Function constructor does not accept TrustedString arguments. See https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor for more information.
workbench.desktop.main.js:64 WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-toolsai.datawrangler' wants API proposal 'debugFocus' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-python.python' wants API proposal 'terminalShellType' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-python.vscode-python-envs' wants API proposal 'terminalShellType' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN Via 'product.json#extensionEnabledApiProposals' extension 'vscjava.vscode-java-pack' wants API proposal 'lmTools' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN Via 'product.json#extensionEnabledApiProposals' extension 'apidev.azure-api-center' wants API proposal 'chatParticipant' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN Via 'product.json#extensionEnabledApiProposals' extension 'apidev.azure-api-center' wants API proposal 'languageModels' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:53 [002] potential listener LEAK detected, having 200 listeners already. MOST frequent listener (1):
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:53 Error
at C1h.create (workbench.desktop.main.js:53:12668)
at $Ce._event [as event] (workbench.desktop.main.js:55:1650)
at $Ce.onFirstObserverAdded (workbench.desktop.main.js:60:51267)
at $Ce.addObserver (workbench.desktop.main.js:60:32621)
at Object.onWillAddFirstListener (workbench.desktop.main.js:53:10463)
at kyn._event [as onDidChange] (workbench.desktop.main.js:55:1917)
at new eR (workbench.desktop.main.js:131:53301)
at SOo._createInstance (workbench.desktop.main.js:15890:2092)
at SOo.createInstance (workbench.desktop.main.js:15890:1521)
at Oco._createModelData (workbench.desktop.main.js:15515:2522)
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:64 ERR [002] potential listener LEAK detected, having 200 listeners already. MOST frequent listener (1):: Error
at C1h.create (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:12668)
at $Ce._event [as event] (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1650)
at $Ce.onFirstObserverAdded (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:60:51267)
at $Ce.addObserver (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:60:32621)
at Object.onWillAddFirstListener (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:10463)
at kyn._event [as onDidChange] (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1917)
at new eR (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:131:53301)
at SOo._createInstance (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15890:2092)
at SOo.createInstance (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15890:1521)
at Oco._createModelData (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15515:2522) ListenerLeakError: [002] potential listener LEAK detected, having 200 listeners already. MOST frequent listener (1):
at C1h.create (workbench.desktop.main.js:53:12668)
at $Ce._event [as event] (workbench.desktop.main.js:55:1650)
at $Ce.onFirstObserverAdded (workbench.desktop.main.js:60:51267)
at $Ce.addObserver (workbench.desktop.main.js:60:32621)
at Object.onWillAddFirstListener (workbench.desktop.main.js:53:10463)
at kyn._event [as onDidChange] (workbench.desktop.main.js:55:1917)
at new eR (workbench.desktop.main.js:131:53301)
at SOo._createInstance (workbench.desktop.main.js:15890:2092)
at SOo.createInstance (workbench.desktop.main.js:15890:1521)
at Oco._createModelData (workbench.desktop.main.js:15515:2522)
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:53 [002] potential listener LEAK detected, having 300 listeners already. MOST frequent listener (101):
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:53 Error
at C1h.create (workbench.desktop.main.js:53:12668)
at $Ce._event [as event] (workbench.desktop.main.js:55:1650)
at $Ce.onFirstObserverAdded (workbench.desktop.main.js:60:51267)
at $Ce.addObserver (workbench.desktop.main.js:60:32621)
at Object.onWillAddFirstListener (workbench.desktop.main.js:53:10463)
at kyn._event [as onDidChange] (workbench.desktop.main.js:55:1917)
at new eR (workbench.desktop.main.js:131:53301)
at SOo._createInstance (workbench.desktop.main.js:15890:2092)
at SOo.createInstance (workbench.desktop.main.js:15890:1521)
at Oco._createModelData (workbench.desktop.main.js:15515:2522)
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:64 ERR [002] potential listener LEAK detected, having 300 listeners already. MOST frequent listener (101):: Error
at C1h.create (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:12668)
at $Ce._event [as event] (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1650)
at $Ce.onFirstObserverAdded (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:60:51267)
at $Ce.addObserver (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:60:32621)
at Object.onWillAddFirstListener (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:10463)
at kyn._event [as onDidChange] (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1917)
at new eR (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:131:53301)
at SOo._createInstance (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15890:2092)
at SOo.createInstance (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15890:1521)
at Oco._createModelData (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15515:2522) ListenerLeakError: [002] potential listener LEAK detected, having 300 listeners already. MOST frequent listener (101):
at C1h.create (workbench.desktop.main.js:53:12668)
at $Ce._event [as event] (workbench.desktop.main.js:55:1650)
at $Ce.onFirstObserverAdded (workbench.desktop.main.js:60:51267)
at $Ce.addObserver (workbench.desktop.main.js:60:32621)
at Object.onWillAddFirstListener (workbench.desktop.main.js:53:10463)
at kyn._event [as onDidChange] (workbench.desktop.main.js:55:1917)
at new eR (workbench.desktop.main.js:131:53301)
at SOo._createInstance (workbench.desktop.main.js:15890:2092)
at SOo.createInstance (workbench.desktop.main.js:15890:1521)
at Oco._createModelData (workbench.desktop.main.js:15515:2522)
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:53 [003] potential listener LEAK detected, having 400 listeners already. MOST frequent listener (1):
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:53 Error
at C1h.create (workbench.desktop.main.js:53:12668)
at Gco._event (workbench.desktop.main.js:55:1650)
at new Yye (workbench.desktop.main.js:12287:27999)
at a (workbench.desktop.main.js:12287:25505)
at sZt.value (workbench.desktop.main.js:12287:26005)
at pe._deliver (workbench.desktop.main.js:55:2962)
at pe._deliverQueue (workbench.desktop.main.js:55:3053)
at pe.fire (workbench.desktop.main.js:55:3390)
at Oco.createModel (workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (workbench.desktop.main.js:11640:22327)
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:64 ERR [003] potential listener LEAK detected, having 400 listeners already. MOST frequent listener (1):: Error
at C1h.create (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:12668)
at Gco._event (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1650)
at new Yye (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:27999)
at a (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:25505)
at sZt.value (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:26005)
at pe._deliver (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:2962)
at pe._deliverQueue (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3053)
at pe.fire (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3390)
at Oco.createModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:11640:22327) ListenerLeakError: [003] potential listener LEAK detected, having 400 listeners already. MOST frequent listener (1):
at C1h.create (workbench.desktop.main.js:53:12668)
at Gco._event (workbench.desktop.main.js:55:1650)
at new Yye (workbench.desktop.main.js:12287:27999)
at a (workbench.desktop.main.js:12287:25505)
at sZt.value (workbench.desktop.main.js:12287:26005)
at pe._deliver (workbench.desktop.main.js:55:2962)
at pe._deliverQueue (workbench.desktop.main.js:55:3053)
at pe.fire (workbench.desktop.main.js:55:3390)
at Oco.createModel (workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (workbench.desktop.main.js:11640:22327)
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:53 [002] potential listener LEAK detected, having 400 listeners already. MOST frequent listener (201):
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:53 Error
at C1h.create (workbench.desktop.main.js:53:12668)
at $Ce._event [as event] (workbench.desktop.main.js:55:1650)
at $Ce.onFirstObserverAdded (workbench.desktop.main.js:60:51267)
at $Ce.addObserver (workbench.desktop.main.js:60:32621)
at Object.onWillAddFirstListener (workbench.desktop.main.js:53:10463)
at kyn._event [as onDidChange] (workbench.desktop.main.js:55:1917)
at new eR (workbench.desktop.main.js:131:53301)
at SOo._createInstance (workbench.desktop.main.js:15890:2092)
at SOo.createInstance (workbench.desktop.main.js:15890:1521)
at Oco._createModelData (workbench.desktop.main.js:15515:2522)
check @ workbench.desktop.main.js:53
(...)
workbench.desktop.main.js:16958 Failed to save 'sort.ts': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.
onDidChangeNotification @ workbench.desktop.main.js:16958
workbench.desktop.main.js:64 ERR [text file model] handleSaveError(0) - exit - resulted in a save error: Error: Unable to write file '/home/frank/dev/trader/frontend/src/pages/max-pain/max-pain.css' (NoPermissions (FileSystemError): Error: EPERM: operation not permitted, open '/home/frank/dev/trader/frontend/src/pages/max-pain/max-pain.css') file:///home/frank/dev/trader/frontend/src/pages/max-pain/max-pain.css
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:16958 Failed to save 'max-pain.css': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.
onDidChangeNotification @ workbench.desktop.main.js:16958
workbench.desktop.main.js:64 ERR [text file model] handleSaveError(0) - exit - resulted in a save error: Error: Unable to write file '/home/frank/dev/trader/frontend/src/pages/portfolio/nasdaq-url.ts' (NoPermissions (FileSystemError): Error: EPERM: operation not permitted, open '/home/frank/dev/trader/frontend/src/pages/portfolio/nasdaq-url.ts') file:///home/frank/dev/trader/frontend/src/pages/portfolio/nasdaq-url.ts
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:16958 Failed to save 'nasdaq-url.ts': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.
onDidChangeNotification @ workbench.desktop.main.js:16958
workbench.desktop.main.js:53 [003] potential listener LEAK detected, having 519 listeners already. MOST frequent listener (71):
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:53 Error
at C1h.create (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:12668)
at Gco._event (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1650)
at new Yye (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:27999)
at a (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:25505)
at sZt.value (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:26005)
at pe._deliver (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:2962)
at pe._deliverQueue (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3053)
at pe.fire (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3390)
at Oco.createModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:11640:22327)
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:64 ERR [003] potential listener LEAK detected, having 519 listeners already. MOST frequent listener (71):: Error
at C1h.create (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:12668)
at Gco._event (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1650)
at new Yye (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:27999)
at a (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:25505)
at sZt.value (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:26005)
at pe._deliver (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:2962)
at pe._deliverQueue (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3053)
at pe.fire (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3390)
at Oco.createModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:11640:22327) ListenerLeakError: [003] potential listener LEAK detected, having 519 listeners already. MOST frequent listener (71):
at C1h.create (workbench.desktop.main.js:53:12668)
at Gco._event (workbench.desktop.main.js:55:1650)
at new Yye (workbench.desktop.main.js:12287:27999)
at a (workbench.desktop.main.js:12287:25505)
at sZt.value (workbench.desktop.main.js:12287:26005)
at pe._deliver (workbench.desktop.main.js:55:2962)
at pe._deliverQueue (workbench.desktop.main.js:55:3053)
at pe.fire (workbench.desktop.main.js:55:3390)
at Oco.createModel (workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (workbench.desktop.main.js:11640:22327)
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 ERR [Extension Host:retrieval] (node:12734) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `exe --trace-deprecation ...` to show where the warning was created)
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:12412 [Extension Host:retrieval] (node:12734) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `exe --trace-deprecation ...` to show where the warning was created)
dbf @ workbench.desktop.main.js:12412
workbench.desktop.main.js:64 WARN [typescript-language-features]: Couldn't find message for key configuration.tsserver.experimental.useBundledNode.unifiedDeprecationMessage.
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:15707 Failed to get git telemetry attributes: Error: Failed to execute git
getGitAttributes @ workbench.desktop.main.js:15707
workbench.desktop.main.js:64 WARN [ExtensionService] No inspect port found for LocalProcess [role: user] pid: 12684 (tryEnableInspector=false).
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN [ExtensionService] No inspect port found for LocalProcess [role: retrieval] pid: 12734 (tryEnableInspector=false).
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN [ExtensionService] No inspect port found for LocalProcess [role: always-local] pid: 12735 (tryEnableInspector=false).
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN [ExtensionService] No inspect port found for LocalProcess [role: agent-exec] pid: 12736 (tryEnableInspector=false).
warn @ workbench.desktop.main.js:64
workbench.desktop.main.js:15542 [composer] Extension host became UNRESPONSIVE undefined Object
error @ workbench.desktop.main.js:15542
workbench.desktop.main.js:15542 [background_composer] Error fetching branches Error: Could not determine default branch Object
error @ workbench.desktop.main.js:15542
workbench.desktop.main.js:15833 [HOOKS] Failed to parse project hooks configuration undefined
logError @ workbench.desktop.main.js:15833
workbench.desktop.main.js:64 ERR [Extension Host:user] 14:14:16.467 ERROR [sandboxPreflight] Preflight failed: Command failed: /usr/share/cursor/resources/app/resources/helpers/cursorsandbox --policy /tmp/sandbox-policy-a2a46ca311b4294c --preflight-only -- /bin/true
Error: Failed to resolve Linux sandbox backend: Unsupported sandbox configuration: Linux auto backend selection failed. Landlock error: Unsupported sandbox configuration: IO error: Step 1-2/7 (user namespace) failed: Failed to unshare namespaces: EACCES: Permission denied. Bubblewrap error: Unsupported sandbox configuration: IO error: Bubblewrap namespace setup failed: Failed to unshare namespaces: EACCES: Permission denied
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:12412 [Extension Host:user] 14:14:16.467 ERROR [sandboxPreflight] Preflight failed: Command failed: /usr/share/cursor/resources/app/resources/helpers/cursorsandbox --policy /tmp/sandbox-policy-a2a46ca311b4294c --preflight-only -- /bin/true
Error: Failed to resolve Linux sandbox backend: Unsupported sandbox configuration: Linux auto backend selection failed. Landlock error: Unsupported sandbox configuration: IO error: Step 1-2/7 (user namespace) failed: Failed to unshare namespaces: EACCES: Permission denied. Bubblewrap error: Unsupported sandbox configuration: IO error: Bubblewrap namespace setup failed: Failed to unshare namespaces: EACCES: Permission denied
dbf @ workbench.desktop.main.js:12412
workbench.desktop.main.js:64 ERR [Extension Host:user] 14:14:16.467 ERROR [sandboxPreflight] Exit status: 2
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:12412 [Extension Host:user] 14:14:16.467 ERROR [sandboxPreflight] Exit status: 2
dbf @ workbench.desktop.main.js:12412
workbench.desktop.main.js:64 ERR [Extension Host:user] 14:14:16.467 ERROR [sandboxPreflight] Stderr: Error: Failed to resolve Linux sandbox backend: Unsupported sandbox configuration: Linux auto backend selection failed. Landlock error: Unsupported sandbox configuration: IO error: Step 1-2/7 (user namespace) failed: Failed to unshare namespaces: EACCES: Permission denied. Bubblewrap error: Unsupported sandbox configuration: IO error: Bubblewrap namespace setup failed: Failed to unshare namespaces: EACCES: Permission denied
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:12412 [Extension Host:user] 14:14:16.467 ERROR [sandboxPreflight] Stderr: Error: Failed to resolve Linux sandbox backend: Unsupported sandbox configuration: Linux auto backend selection failed. Landlock error: Unsupported sandbox configuration: IO error: Step 1-2/7 (user namespace) failed: Failed to unshare namespaces: EACCES: Permission denied. Bubblewrap error: Unsupported sandbox configuration: IO error: Bubblewrap namespace setup failed: Failed to unshare namespaces: EACCES: Permission denied
dbf @ workbench.desktop.main.js:12412
workbench.desktop.main.js:15542 [transport] Connect error in unary AI connect ConnectError: [unauthenticated] You must be a team member to access this resource
at t (workbench.desktop.main.js:12452:493305)
at async Object.getTeamCommands (workbench.desktop.main.js:7791:59906)
at async KDo.loadTeamCommands (workbench.desktop.main.js:17043:6027) Object
error @ workbench.desktop.main.js:15542
workbench.desktop.main.js:17043 Failed to load team commands: ConnectError: [unauthenticated] You must be a team member to access this resource
at t (workbench.desktop.main.js:12452:493305)
at async Object.getTeamCommands (workbench.desktop.main.js:7791:59906)
at async KDo.loadTeamCommands (workbench.desktop.main.js:17043:6027)
loadTeamCommands @ workbench.desktop.main.js:17043
workbench.desktop.main.js:9027 [PluginsProviderService] getPluginMcpServers took 7210.9ms
_callWithTimeout @ workbench.desktop.main.js:9027
workbench.desktop.main.js:9027 [PluginsProviderService] getPluginHooks took 3965.2ms
_callWithTimeout @ workbench.desktop.main.js:9027
workbench.desktop.main.js:9027 [PluginsProviderService] getPluginMcpServers took 2595.4ms
_callWithTimeout @ workbench.desktop.main.js:9027
workbench.desktop.main.js:12412 [Extension Host:agent-exec] 14:14:20.872 WARN computeGlobalCache: slow ctx=LocalRequestContextExecutor.rebuildGlobalCache/LocalRequestContextExecutor.computeGlobalCache meta={totalMs: 2038, cloudRule: 25, codebaseRef: 233, subagents: 1636, cursorRules: 2033, ruleCount: 31}
dbf @ workbench.desktop.main.js:12412
workbench.desktop.main.js:15833 [HOOKS] Failed to parse project hooks configuration undefined
logError @ workbench.desktop.main.js:15833
workbench.desktop.main.js:16656 Timed out getting tasks from typescript
(anonymous) @ workbench.desktop.main.js:16656
workbench.desktop.main.js:16656 Timed out getting tasks from npm
(anonymous) @ workbench.desktop.main.js:16656
workbench.desktop.main.js:53 [003] potential listener LEAK detected, having 544 listeners already. MOST frequent listener (72):
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:53 Error
at C1h.create (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:12668)
at Gco._event (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1650)
at new Yye (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:27999)
at a (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:25505)
at sZt.value (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:26005)
at pe._deliver (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:2962)
at pe._deliverQueue (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3053)
at pe.fire (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3390)
at Oco.createModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:11640:22327)
check @ workbench.desktop.main.js:53
workbench.desktop.main.js:64 ERR [003] potential listener LEAK detected, having 544 listeners already. MOST frequent listener (72):: Error
at C1h.create (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:53:12668)
at Gco._event (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:1650)
at new Yye (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:27999)
at a (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:25505)
at sZt.value (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:12287:26005)
at pe._deliver (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:2962)
at pe._deliverQueue (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3053)
at pe.fire (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3390)
at Oco.createModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:11640:22327) ListenerLeakError: [003] potential listener LEAK detected, having 544 listeners already. MOST frequent listener (72):
at C1h.create (workbench.desktop.main.js:53:12668)
at Gco._event (workbench.desktop.main.js:55:1650)
at new Yye (workbench.desktop.main.js:12287:27999)
at a (workbench.desktop.main.js:12287:25505)
at sZt.value (workbench.desktop.main.js:12287:26005)
at pe._deliver (workbench.desktop.main.js:55:2962)
at pe._deliverQueue (workbench.desktop.main.js:55:3053)
at pe.fire (workbench.desktop.main.js:55:3390)
at Oco.createModel (workbench.desktop.main.js:15516:1370)
at Lwe.doCreateTextEditorModel (workbench.desktop.main.js:11640:22327)
error @ workbench.desktop.main.js:64
workbench.desktop.main.js:64 WARN [WorktreeManager] Timed out after 5000ms waiting for local agent scan; orphan classification disabled this pass
warn @ workbench.desktop.main.js:64
warn @ workbench.desktop.main.js:64
warn @ workbench.desktop.main.js:16973
(anonymous) @ workbench.desktop.main.js:15811
(anonymous) @ workbench.desktop.main.js:59
setTimeout
e.setTimeout @ workbench.desktop.main.js:12487
Fv @ workbench.desktop.main.js:59
waitForAgentRepositoryReady @ workbench.desktop.main.js:15811
cleanupWorktrees @ workbench.desktop.main.js:15811
performCombinedCleanup @ workbench.desktop.main.js:15811
await in performCombinedCleanup
performCleanup @ workbench.desktop.main.js:15811
await in performCleanup
(anonymous) @ workbench.desktop.main.js:15811
(anonymous) @ workbench.desktop.main.js:59
This is a really interesting debugging case. The difficult part here isn’t identifying that files are changing, but establishing which process is actually responsible for the writes and separating the application’s behavior from the IDE/agent’s behavior.
The fact that ftrace showed the Cursor process writing the files seems like the key piece of evidence. It also highlights how easy it is for an AI coding agent to keep reasoning inside the wrong hypothesis space when the underlying cause is outside the codebase itself.
Thanks, the console log was useful too. Here’s what it shows:
A listener leak that grows during the session (200 → 300 → 400 → 500+ listeners), and the stack points to text editor model creation (doCreateTextEditorModel / createModel). That matches the idea that the set of persisted inline diffs is being reopened again and again.
At some point there’s Extension host became UNRESPONSIVE. That lines up with the ~5-minute extension host restarts that showed up in main.log.
Errors like Failed to save ... EPERM / NoPermissions on files in frontend/. That means your chattr +i is working as intended and blocking force-save. So the workaround really was preventing writes at that moment.
What’s still missing is a clear sign of a full window reload or renderer reload right around the two back-to-back rewrite events (the log is cut off in the middle). The growing listener leak on the model creation path is a good indirect signal that the restore path is running repeatedly, but there’s no direct reload event in this snippet.
This isn’t intended behavior and it’s not something about your project setup. This is a known issue, we’re tracking it, and I added all of the above to what I already shared with the team. I can’t give an ETA yet, but I’ll reply here when there’s an update.
If you can catch it again, the most valuable thing is an uncut Console slice Help > Toggle Developer Tools > Console exactly between the two neighboring rewrite events. If a window or renderer reload shows up there, that answers the last open question.
For now, the workarounds are the same: Keep or Reject all pending edits before you exit, start a new chat after a long agent session in an SVN workspace, restore via cp / svn revert instead of bulk-restore in the editor.
Good catch. The hard part here wasn’t that files were changing, it was proving who was writing them. fatrace with attribution to the Cursor main PID ruled out the other options (Vite, task runner, shell) and pointed straight to the source.
And yeah, the point about reasoning inside the wrong hypothesis space is spot on. The agent was stuck looking inside the codebase, while the real cause was outside it, at the editor’s own restore path level. That’s why an OS-level system trace ended up being the deciding factor.
The fix for repeated rewrites of files with identical content is on the way. It’ll ship in one of the next Cursor updates on the 3.15 branch, newer than 3.15.6. Cursor will stop re-saving files from the persistent agent diff if the file content already matches what’s on disk. So the loop you saw via fatrace should stop once you update to a version newer than 3.15.6.
A couple important notes:
This isn’t in the current stable yet, so updating to latest right now won’t fix it. Please try again after a version newer than 3.15.6 is released.
The original 0-byte wipe you recovered from is a separate issue we’re still tracking. So the workarounds I shared are still valid. Keep or Reject all pending agent edits before you quit Cursor, and restore files via cp or svn revert, not a bulk restore inside the editor.
If, after updating, files are still getting rewritten or zeroed out, reply here and we’ll dig in further.