# Critical: SSH Remote deletes ENTIRE home directory when workspace is set to `~` — repeated data loss including conda, SSH keys, PDFs, and project files
## Summary
When using Cursor SSH Remote with the workspace set to the user’s **home directory** (`/home/liuzhenyin`), Cursor’s reconnect/session-reset logic **physically deletes nearly all files** from the home directory — including `miniconda3/`, `.ssh/`, `.bashrc`, project directories, and multi-GB research data. This happened **at least 3 times** within a single hour on June 16, 2026, while I was actively working.
This is the most destructive variant of the known SSH file-deletion bug. Because the workspace was `~`, the blast radius was the **entire home directory**, not just a project folder.
## Environment
| Item | Value |
|------|-------|
| Local OS | Windows |
| Remote OS | Ubuntu 20.04.6 LTS, kernel 5.15.0-60-generic |
| Remote filesystem | btrfs 17TB on /dev/sda1, mounted at /home |
| Cursor server commit | `776d1f9d76df50a4e0aeca61819a88e7c1b861e0` |
| Connection | SSH Remote (Anysphere Remote SSH) |
| Workspace path | `/home/liuzhenyin` (the entire home directory) |
| Hostname | SRJ (shared lab server, multi-user) |
## What happened
### Timeline (all times CST, June 16, 2026)
**Occurrence 1 — between Jun 14 and Jun 16 15:49**
- Jun 14: Long working session. Home contained: git repo, miniconda3, SSH keys, ~40 MinerU-parsed PDFs, `.env`, project configs.
- Jun 16 15:48–15:49: First login from a new IP. **Everything gone.** Home contains only `.cursor-server/`, `.cursor/`, `.cache/`, `.local/`.
**Occurrence 2 — 16:25 → 16:31**
- 16:19–16:25: Restored project from GitHub, reinstalled miniconda, re-ran MinerU, regenerated SSH keys.
- 16:31: MinerU hit `FileNotFoundError` mid-run — PDF gone. `ls ~/` empty again. `stat ~` mtime → 16:31:58.
**Occurrence 3 — ~16:35**
- Home cleaned again during the same Cursor session.
### Evidence: not admin, not cron, not user error
| Ruled out | Evidence |
|-----------|----------|
| User deleted files | No `.bash_history` (fresh home); only my account active |
| Admin/cron cleanup | Empty crontab; system cron only logrotate/apt |
| Temporary filesystem | btrfs 17T on `/dev/sda1`, not tmpfs |
| System reboot | Last reboot Jun 12 |
| Other users affected | Other home dirs untouched (mtimes Jun 12–15) |
| Agent commands | Full transcript reviewed — no `rm -rf ~` |
### Evidence: Cursor is the cause
1. **Surviving files = Cursor footprint only**: `.cursor/`, `.cursor-server/`, `.cache/`, `.local/`
2. **Timing matches Cursor activity**, not idle periods
3. **`.cursor-server/data/snapshots/`** has only transcripts/terminals — NOT project files or conda
4. **Terminal log at deletion moment**:
```
16:31:37 unzip completed (16 zips) ← files exist
16:31:47 FileNotFoundError: PDF gone ← deleted mid-process
16:31:58 stat ~ mtime updated
```
5. **Same pattern as known reports** (see related threads below)
### What was lost (each time)
| Item | Recoverable? |
|------|--------------|
| Project code (~100 files) | Yes — GitHub |
| miniconda3 (~2 GB) | No — reinstall |
| ~/.ssh/ | No — regenerate keys |
| .env, .bashrc | No |
| knowledge/parsed/ (~500 MB, 40 docs) | No — re-run MinerU ($) |
| knowledge/raw/*.pdf (33 files) | No — re-upload |
**~3 GB lost per occurrence. 3 times in 1 hour.**
## Why this is worse than previous reports
Previous reports: deletion within a **project folder**.
My case:
1. **Workspace = `~`** → entire home is in scope
2. **Non-project files destroyed**: conda, SSH keys, shell config
3. **No git protection** for miniconda, PDFs, `.ssh`
4. **Active long-running process** interrupted when files deleted under it
5. **Repeated 3x/hour** — each recovery destroyed by next reset
## Root cause hypothesis
Same as forum topic **#163075** (Remote-SSH deletes files on reconnect/checkpoint):
> Reconnect reconciles recently-touched files against a **stale or empty snapshot**, and **pushes deletes to disk** for files not in that snapshot.
When workspace = `~`, snapshot only has Cursor metadata → everything else gets deleted.
## Requested fixes
1. **Never delete on empty/stale snapshot** (also requested in #163075)
2. **Warn or block workspace = home directory**
3. **Never delete outside project/git tree** (conda, `.ssh`, dotfiles)
4. **Confirm before bulk delete**
5. **Trash instead of permanent delete**
## Steps to reproduce (WARNING: destructive)
1. SSH Remote, open `~` as workspace
2. Add conda, SSH keys, git project, large data files
3. Work 1+ hours with AI agent edits
4. Trigger reconnect/reload (network blip or session reset)
5. Observe: home cleaned, only `.cursor*` remains
## Related threads (topic IDs — add links in a follow-up comment if needed)
- **#154049** — Critical bug, SSH Remote deletes workspace files on disconnect/reconnect (3rd occurrence)
- **#163075** — Remote-SSH deletes files on reconnect / Restore Checkpoint (server-side logs)
- **#152075** — Undo deletes files on SSH Remote workspace
- **#154532** — Files deleted after SSH reconnection during remote editing
- **#154495** — Cursor IDE rogue file deletion
*(New forum accounts are limited to 2 links per post. Search these topic IDs on forum.cursor.com.)*