Preflight Checklist
What's Wrong?
During a Nextcloud server migration task, Claude Code ran rm -rf on a directory that had a live NFS share mounted
inside it, without explicit user approval for that destructive action, and without first verifying the NFS was
unmounted. This resulted in the deletion of production user data from the NAS.
Impact:
- Total loss of production Nextcloud user data from NAS storage.
- Recovery in progress (not including Claude on this- "lack of trust"...)
What Should Happen?
Before running any rm -rf on a directory that may contain or be adjacent to mounted filesystems, Claude should:
- Explicitly identify the risk to the user.
- Ask for confirmation before proceeding.
- Verify all mounts are unmounted before any destructive file operations.
- Delete the entire data is not part of a Nextcloud upgrade. So, more than one tthing here doen't make any sense.
Error Messages/Logs
Steps to Reproduce
- Set up a VM with an NFS share mounted inside a web root directory, e.g.:
- NFS export: #######
- Mounted at: /var/www/html/nextcloud/data on the VM
- Ask Claude Code to migrate web application files from one VM to another. In the process, Claude will need to
replace the contents of /var/www/html/nextcloud/ with a new version.
- Claude will write and execute a script via SSH (paramiko) containing:
cd /var/www/html
rm -rf nextcloud
tar -xzf /tmp/new_files.tar.gz
- without first checking whether any NFS or other filesystems are mounted inside the target directory, and
without asking the user for confirmation.
- The rm -rf nextcloud runs as root. With no_root_squash on the NFS export, root on the client has full write
access to the NAS. The command deletes all files inside the NFS mount before reaching the mountpoint directory
itself (which fails with EBUSY).
- The command times out on the paramiko side. Claude then checks for running processes, finds none, sees the
directory still exists, and incorrectly reports to the user that no data was deleted and the NAS is safe.
- User discovers data is gone when checking the NFS directory directly.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.80
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
No response
Preflight Checklist
What's Wrong?
During a Nextcloud server migration task, Claude Code ran rm -rf on a directory that had a live NFS share mounted
inside it, without explicit user approval for that destructive action, and without first verifying the NFS was
unmounted. This resulted in the deletion of production user data from the NAS.
Impact:
What Should Happen?
Before running any rm -rf on a directory that may contain or be adjacent to mounted filesystems, Claude should:
Error Messages/Logs
Steps to Reproduce
replace the contents of /var/www/html/nextcloud/ with a new version.
cd /var/www/html
rm -rf nextcloud
tar -xzf /tmp/new_files.tar.gz
without asking the user for confirmation.
access to the NAS. The command deletes all files inside the NFS mount before reaching the mountpoint directory
itself (which fails with EBUSY).
directory still exists, and incorrectly reports to the user that no data was deleted and the NAS is safe.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.80
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
No response