Feature: setting to disable Undo Create Diff (prevents 0-byte / 524288 truncation)

Describe the request

Feature / Bug: Please provide a setting to disable Undo Create Diff (mass file wipe / 524288 truncation)

Related: Bug report: mass local file wipe via Undo Create Diff on restart
Request: Product setting to disable / opt out of Undo Create Diff bulk write-back. Current mitigations (timeline.excludeSources, Agent rules) cannot block this path.

Environment

  • OS: Windows Server / Win10 build 10.0.14393 (win32)
  • Project: large monorepo (API + Web + C++ Qt)
  • Local History: kept enabled for recovery (workbench.localHistory.enabled: true)
  • Already applied: timeline.excludeSources: ["timeline.localHistory"] — only hides Timeline UI, does not stop Undo Create Diff

What happened (2026-09-12 ~14:24–14:27 local)

Same failure mode as known “mass wipe via Undo Create Diff”:

File Symptom
packages/api/src/routes/sales.ts Truncated to exactly 524288 bytes (half EOF → esbuild Unexpected end of file)
packages/api/src/routes/delivery-special-price.ts Written to 0 bytes → Express Router.use() requires a middleware function but got a Object
packages/api/src/routes/counter-reconciliation.ts Written to 0 bytes

Recovery: Volume Shadow Copy (HarddiskVolumeShadowCopy17, 14:00) + re-apply intentional edits. Truncated copy kept as sales.ts.truncated-before-restore-*.

Evidence (Local History)

In %APPDATA%\Cursor\User\History\*\entries.json, between 14:26:34 and 14:27:13 local time:

  • 809 history entry files updated in ~40 seconds
  • All 809 had source: "Undo Create Diff" (undoCount=809)
  • Span covered API / web-admin / C++merchant-client / wx-admin / docs / migrations — classic bulk Undo Create Diff, not a single Agent Write empty file

This matches prior incidents on the same machine (documented in project rules: 2026-08-16 / 08-22 / 08-23 / 09-09).

Why we need a product switch

We already:

  1. Forbid Agent empty/Write overwrite of existing sources (workspace rules)
  2. Hide Local History from Timeline to reduce mis-clicks
  3. Instruct: never use Timeline one-click Undo Create Diff; prefer Checkpoint / per-file restore / VSS / Git

None of these can disable Composer/Agent Review Undo / Undo All or session-restore paths that still emit Undo Create Diff and rewrite disk.

Expected product behavior

Please add one of:

  1. Setting e.g. cursor.agent.disableUndoCreateDiff: true or cursor.composer.bulkUndoDiff: "off" — refuse bulk Undo Create Diff write-back
  2. Or: Undo Create Diff must never write empty / truncated content; fail closed and keep previous bytes
  3. Or: require explicit typed confirmation for Undo affecting >N files

Also: document that timeline.excludeSources ≠ disabling Undo Create Diff.

Mitigations we added locally (insufficient)

"files.restoreUndoStack": false,
"workbench.restoreEditors": "none"

(plus existing Timeline exclude + Local History kept on)

Does this stop us from using Cursor?

No — but it repeatedly destroys large source files and burns recovery time. We need an official kill-switch.


Paste target: Bug Reports - Cursor - Community Forum (or Feature Requests) → New Topic
Title suggestion: Feature: setting to disable Undo Create Diff (prevents 0-byte / 524288 truncation)

Hey @gunhun322, thanks for the detailed write-up and for the Local History evidence, that lines up with what we’re seeing!

To be clear, this isn’t something you misconfigured. On startup Cursor re-applies any agent edits that are still pending review, and on Windows that re-save can leave files empty or cut off if it’s interrupted. It’s a known issue the team is actively working on, and some related fixes have already shipped in recent versions. I can’t share a timeline for the rest yet, but we’ll share an update when we have one.

The most reliable way to avoid it in the meantime is to clear every pending agent change (Keep All or Undo All in Review Changes) before you quit, update, or restart, and to keep committing often. Discarding via git alone doesn’t clear the pending state, so those files can be rewritten again on the next launch until they’re resolved in Cursor.