# Workspace files truncated to 0 bytes (Local History since 2026-08-07)

**URL:** <https://forum.cursor.com/t/workspace-files-truncated-to-0-bytes-local-history-since-2026-08-07/168074>\
**Category:** Bug Reports\
**Created:** [August 12, 2026, 1:47am UTC](https://forum.cursor.com/t/workspace-files-truncated-to-0-bytes-local-history-since-2026-08-07/168074 "2026-08-12T01:47:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Da\_Yede](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@Da\_Yede](https://forum.cursor.com/u/Da_Yede)\
**Post date:** [August 12, 2026, 1:47am UTC](https://forum.cursor.com/t/workspace-files-truncated-to-0-bytes-local-history-since-2026-08-07/168074/1 "2026-08-12T01:47:28Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

# Bug Report: Multiple workspace files truncated to 0 bytes without attributable write

**Date observed:** 2026-08-11 (local empty on disk); Local History empty snapshots since 2026-08-07 ~10:05  
**Cursor version:** 3.15.6 (commit `a1f686545fd0ce8917bbd2449f733551a9bce420`, stable)  
**OS:** macOS 26.5.2 (Darwin 25.5.0, arm64, Apple Silicon)  
**Repos:** `simulation-training-manage-web` and (update) `simulation-training-user-web`, both branch `test` (Git working tree only; remote untouched)

## Summary

Four tracked source files in the workspace were truncated to empty (0 bytes) as uncommitted local changes. Remote/HEAD content remained intact. No git commit author, no shell truncate command, and no Agent Write tool call in the investigating chat could be attributed. Cursor Local History began recording 0-byte snapshots for these files starting at the Cursor session that began 2026-08-07 10:05, and continued across later sessions.

## Affected files (at time of discovery)

- `src/views/asset/AssetIndex.vue` (~2628 lines → 0)
- `src/views/root-cause/RootCauseIndex.vue` (~1626 lines → 0)
- `src/views/login/OaLoginPage.vue` (~114 lines → 0)
- `src/views/login/OaLoginExpiredPage.vue` (~54 lines → 0)

`git diff --numstat` showed `0 <old_line_count>` for each (pure deletion). Git blob hash after truncate was empty blob `e69de29`.

## Timeline / evidence

1. **2026-08-07 ~08:59** — Local History still had full content (e.g. AssetIndex history entry `Fk3C.vue` = 76862 bytes, matching HEAD).
2. **2026-08-07 ~10:05** — New Cursor log session `logs/20260807T100504`. Immediately afterward, Local History entries for the four files become 0 bytes (e.g. AssetIndex `NVDH.vue`, RootCause `x5ry.vue` / `V6EM.vue`).
3. **2026-08-10 / 2026-08-11 morning** — Further 0-byte Local History snapshots at Cursor session times (08:31, 08:40, 08:55, 09:24, 10:15).
4. **2026-08-11 10:14** — User inspected SCM diffs; Git extension logged `git show HEAD:...` for all four files (already showing as modified/empty vs HEAD).
5. **2026-08-11 10:15:48** — `git pull --tags origin test` (fast-forward 402b158..def0b58). Empty working-tree state predated and persisted around this.
6. **2026-08-11 10:16:22** — All four files on disk had the **same mtime** , size 0 (batch truncate/write).
7. Investigating Agent chat started ~10:16; only read/`git` commands — **did not write** these files. Restored later via `git restore`.

## Local History paths (for Cursor eng)

- `~/Library/Application Support/Cursor/User/History/5961af8c/` → AssetIndex.vue
- `~/Library/Application Support/Cursor/User/History/12daffe1/` → RootCauseIndex.vue
- `~/Library/Application Support/Cursor/User/History/36d5e605/` → OaLoginPage.vue
- `~/Library/Application Support/Cursor/User/History/5ba315ce/` → OaLoginExpiredPage.vue

## Cursor logs of interest

- `~/Library/Application Support/Cursor/logs/20260807T100504/` (first empty Local History wave)
- `~/Library/Application Support/Cursor/logs/20260811T083125/window2/exthost/vscode.git/Git.log` (10:14+ SCM inspection)
- `~/Library/Application Support/Cursor/logs/20260811T083125/window4_wb9/exthost/vscode.git/Git.workspaceId-*.log` (10:16+ diff of the four files)

## What we ruled out

- Not a remote/git commit (origin/test still had full content; change was unstaged local only)
- Not the investigating Agent turn (no Write/Delete; files already empty in SCM before that chat)
- No matching truncate/`>` patterns in recent zsh history for these paths

## Suspected area (unproven)

Hot Exit / editor tab restore / Local History save path writing empty buffers back to disk across session restarts — correlation with session start times is strong, but root cause was not proven from available logs.

## Impact

Silent data loss in the working tree for large source files. Recoverable only because Git HEAD still had content. High trust impact.

## Workaround used

```bash
git restore src/views/asset/AssetIndex.vue \
  src/views/root-cause/RootCauseIndex.vue \
  src/views/login/OaLoginPage.vue \
  src/views/login/OaLoginExpiredPage.vue

```

Working tree clean after restore; line counts match prior HEAD.

* * *

## Update 2026-08-11: Also reproduced in sibling project `simulation-training-user-web`

**Repo:** `/Users/huabo/dev/yzsz/jl/simulation-training-user-web` (branch `test`)

### Affected

- `src/views/MainLayout.vue` (258 lines → 0 bytes)

Disk mtime at discovery/restore time: **2026-08-11 09:24:46** (same clock bucket as manage-web Local History empty snapshots at 09:24).

### Local History

- `~/Library/Application Support/Cursor/User/History/c3b728/` → MainLayout.vue
- Last good content: Aug 7 ~08:59 / 10:05 (`faOl.vue` / earlier = 6839 bytes)
- Empty snapshots from **2026-08-07 10:05** onward (same Cursor session wave as manage-web), then Aug 10 and Aug 11 morning session times (08:31, 08:40, 08:55, 09:24)

### Scan

- Only this one empty tracked file under `src/` at check time; no other zero-byte tracked files after restore.
- Restored with `git restore src/views/MainLayout.vue` (258 lines restored).

### Cross-repo implication

Same failure mode across two separate Git repos opened in Cursor, with empty Local History starting in the **same** Cursor session (`20260807T100504`). Stronger evidence this is an editor/session restore issue rather than a one-off accidental edit in a single project.

### Steps to Reproduce

This is intermittent and we could not find a 100% reliable one-click repro. Closest observed sequence:

1. Open multiple Cursor windows/workspaces, including at least:
  - simulation-training-manage-web
  - simulation-training-user-web

2. Keep several large Vue source files open across sessions (or previously opened so Hot Exit / Local History tracks them), e.g.:
  - AssetIndex.vue, RootCauseIndex.vue, OaLoginPage.vue, OaLoginExpiredPage.vue
  - MainLayout.vue (user-web)

3. Quit / restart Cursor (or leave it running across multiple session starts).
4. After a later session start, check git status / Source Control.
5. Observe that one or more tracked files are truncated to 0 bytes as unstaged local changes (git empty blob e69de29), while HEAD/remote still have full content.

Observed correlation (not proven causal):

- Empty Local History snapshots for the affected files began in Cursor session logs/20260807T100504 (~2026-08-07 10:05).
- Further 0-byte Local History entries appeared at later session times (Aug 10 / Aug 11 morning).
- On 2026-08-11, manage-web’s 4 files shared the same disk mtime when truncated; user-web MainLayout.vue was also empty around the same morning window.
- No Agent Write/Delete and no shell truncate command could be attributed for the investigating turn.

Workaround:  
git restore

### Operating System

MacOS

### Version Information

Version Information

- Cursor: 3.15.6 (stable)
- Commit: a1f686545fd0ce8917bbd2449f733551a9bce420
- OS: macOS 26.5.2 (Build 25F84)
- Arch: arm64 (Apple Silicon)
- Date of report: 2026-08-12

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![mohitjain](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/mohitjain/32/100229_2.png) [@mohitjain](https://forum.cursor.com/u/mohitjain)\
**Post date:** [August 12, 2026, 10:52am UTC](https://forum.cursor.com/t/workspace-files-truncated-to-0-bytes-local-history-since-2026-08-07/168074/7 "2026-08-12T10:52:29Z")

</div>

Hey there,

What you’re describing isn’t intended behavior, and it’s not caused by anything on your end. It’s an issue we’re tracking.

One thing that matters for your case: `git restore` fixed the files on disk, but it doesn’t clear the pending Agent (Create Diff) changes that trigger this, so those files can get re-emptied on a future launch until you resolve them in Cursor:

1. Open Review Changes and resolve every pending Agent change (Keep All / Undo All) - wait until the list is empty before quitting or updating.
2. For a restored file still showing as pending, confirm the content is visible, then choose Keep (not Undo - Undo would blank it again).
3. Commit frequently as a safety net.

`files.autoSave` / `files.hotExit` don’t affect this path. I’ll post here when there’s an update.
