[MODEL] Files deleted outside the working directory during auto-approve session (unrecoverable data loss)

Status Open
Reported on v2.1.222
Maintainer reply None cached
Activity 1 comment · opened Aug 5, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

Session Recovery Note

  • Session ID: ef2a3072-8172-4a40-8806-3182d90c7d01
  • Started: 2026-08-05 11:48:40 PKT
  • Working directory: /Users/mac/Desktop/Polotono Embed
  • Launched from: VS Code extension
  • permissionMode: auto (commands execute without a confirmation prompt)

I was building a Polotno embed feature.

My last prompt before the incident, recovered from the surviving session metadata stub, was:

"okay can you build this so i can test this ..? and what things i need to do for to build for sample"

That is all I asked for: to build the project so I could test it.

I never asked Claude to:

  • delete anything,
  • reset anything, or
  • clean up any directory.

What Claude Actually Did

Incident Report (Expanded)

IMPORTANT CAVEAT UP FRONT: I cannot prove Claude performed these deletions. ~/.claude was destroyed in the same event, so the session transcript is gone and I cannot see the tool calls. Everything below comes from macOS and VS Code logs that still exist on my machine. I am reporting it because it occurred during this session, within this session’s working window. Please check the server-side transcript to confirm or rule it out.

All times are PKT (UTC+5), 2026-08-05.

---

Timeline

1. 12:45:22 — Project still intact

Kernel sandbox log references a file inside the project:

Sandbox: spindump(1571) deny(1) file-read-data
/Users/mac/Desktop/Polotono Embed/node_modules/@rolldown/binding-darwin-x64/rolldown-binding.darwin-x64.node

This indicates the project directory still existed at that time.

---

2. 12:47:34–35 — ~/.claude emptied

From Claude VSCode.log:

12:47:34.914  Detected skill change: /Users/mac/.claude/skills/react-native-frontend/SKILL.md
12:47:35.215  Loading skills... -> "Loaded 0 unique skills (user: 0)"
12:47:35.215  Failed to stat directory /Users/mac/.claude/commands: ENOENT
12:47:35.219  Failed to stat directory /Users/mac/.claude/agents: ENOENT

These entries show the extension suddenly saw the entire ~/.claude structure disappear.

---

3. 12:47:46–48 — Mass filesystem event burst

From renderer.log:

[File Watcher ('parcel')] Events were dropped by the FSEvents client.
File system must be re-scanned. (path: /Users/mac/Desktop/Polotono Embed)

This message appeared five times, consistent with a very large number of filesystem changes in a short interval.

---

4. 12:47:52 — Project directory deleted, then recreated

From renderer.log:

12:47:52.650  [File Watcher ('parcel')] Watcher shutdown because watched path got deleted
               (path: /Users/mac/Desktop/Polotono Embed)
12:47:52.66x  ENOENT: package.json, tsconfig.json, node_modules/polotno,
               node_modules/konva, node_modules/vite, ...

The APFS birth time of /Users/mac/Desktop/Polotono Embed is 12:47:52, indicating the folder was recreated in the same second after deletion.

---

5. 12:47:53 — Source files missing

From fileWatcher.log:

ENOENT: src/App.tsx, src/main.tsx, src/Editor.tsx

Core source files were gone immediately after the directory event.

---

6. 12:48:11 — Spotlight confirms bulk deletion

From the Spotlight indexer log:

mds_stores: (SpotlightIndex) Flush for high delete count

This is consistent with a large number of file deletions occurring moments earlier.

---

Deleted Paths

Deleted inside the working directory

  • /Users/mac/Desktop/Polotono Embed/ — all source files and node_modules

Deleted outside the working directory

These paths were unrelated to the active project and are the main concern:

  • /Users/mac/Desktop/life-ai/ — unrelated project
  • ~/.claude/ — including conversation history under ~/.claude/projects/
  • ~/.local/ — Claude Code CLI removed; claude no longer on PATH
  • ~/.config/gh/ — GitHub CLI authentication lost
  • ~/.continue/
  • ~/.codeium/
  • ~/.zsh_history — reduced to 0 bytes

---

Trash Was Not Used

After 12:00 that day, ~/.Trash contained 0 items. This indicates a direct programmatic deletion (unlink / rm) rather than a Finder move-to-trash operation.

---

Why This Does Not Look Like Disk Cleanup

Large storage consumers remained untouched:

  • ~/.vscode (~3 GB)
  • ~/.ollama (~35 GB)
  • ~/.npm (~10 GB)
  • ~/.gradle
  • ~/.cache
  • ~/.android (~25 GB)

A storage optimizer would typically target those locations first.

---

Effect on Session History

The file:

ef2a3072-8172-4a40-8806-3182d90c7d01.jsonl

still exists but is only 354 bytes and contains only last-prompt and ai-title metadata.

No conversation messages remain.

The VS Code extension still lists the session, but opening it shows:

Error: Claude Code returned an error result:
No conversation found with session ID: ef2a3072-8172-4a40-8806-3182d90c7d01

---

What I Am Requesting

Please retrieve the server-side transcript for session:

ef2a3072-8172-4a40-8806-3182d90c7d01

and review all Bash/tool activity between:

2026-08-05 12:47:30 PKT
2026-08-05 12:48:00 PKT

Specifically, I would like to know:

  1. What commands were executed.
  2. Whether any destructive command was issued.
  3. Why any command reached paths outside the working directory.
  4. If no such command was issued by Claude Code, whether another process appears responsible.

---

Available Logs

I can provide the complete VS Code log directory:

~/Library/Application Support/Code/logs/20260804T112322/window6/

including:

  • renderer.log
  • fileWatcher.log
  • exthost/Anthropic.claude-code/Claude VSCode.log

---

Impact

  • Approximately 1 day of work lost on the Polotono project.
  • Loss of local Claude Code conversation history.
  • No Time Machine backup was configured.
  • I recovered 74 files (808 KB) from editor local-history caches; the remaining data appears unrecoverable.

---

Environment

  • OS: macOS 15.6.1 (24G90)
  • Hardware: MacBookPro16,1
  • Architecture: x86_64
  • Editor: VS Code
  • Extension: Anthropic claude-code
  • installMethod: native
  • Timezone: PKT (UTC+5)

Expected Behavior

Expected Safe Behavior

Claude should have:

  1. Built the project as requested — nothing more.
  2. Never touched anything outside the working directory (/Users/mac/Desktop/Polotono Embed). The paths ~/Desktop/life-ai, ~/.local, ~/.config/gh, ~/.continue, ~/.codeium, and ~/.zsh_history have no connection to this project or to a build operation.
  3. Stopped and asked before any recursive deletion, even in auto-approve mode. Auto-approve should cover routine edits, installs, and build commands, not irreversible deletion of directories.
  4. Never deleted ~/.claude, because that removed the conversation history, which was both my data and the only local record of what commands were executed.
  5. Requested confirmation before recreating the project directory. If a clean directory was required for scaffolding, the tool should have explained that and waited for approval instead of deleting and recreating the folder automatically.

Regardless of what ultimately triggered the event, a build request should not be capable of deleting files across the home directory, and destructive operations should not bypass the macOS Trash.

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

No, only happened once

Steps to Reproduce

_No response_

Claude Model

Sonnet

Relevant Conversation

Impact

Critical - Data loss or corrupted project

Claude Code Version

2.1.222

Platform

Anthropic API

Additional Context

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗