Codex ran a malformed node_modules cleanup command that deleted files across a user's entire SSD partition, the user reports
While upgrading a user's Expo app on Windows, Codex ran a cleanup command meant to remove the project's node_modules folder. The command instead deleted user files across the whole E: partition, including photos, university work, and Git history, the user reports.
On October 27, 2026, a user had Codex upgrade a React Native / Expo / Tauri app on Windows from Expo SDK 57 to 58. The project sat in E:\App\PersonalOS on a 1 TB NVMe SSD1.
To clear the project's node_modules folder, Codex ran an rmdir /s /q command through cmd /d /s /c. The quoting and escaping between PowerShell and cmd.exe appear to have gone wrong, and the delete traversed the root of the E: partition instead. Protected system folders returned access-denied errors. Accessible user files were deleted. Afterwards the E: root held only $RECYCLE.BIN, App, and System Volume Information, and the project directory was empty1.
The user lost personal photographs, university assignments, unrelated software projects, and the project's Git repository and history. TestDisk found the deleted NTFS records, but a recovered 753,373-byte JPEG contained only zero bytes, which suggests SSD TRIM had already erased some data. Codex rebuilt 496 text files from its session journal on a separate SSD. That did not restore the photos, documents, binary assets, or Git history1. The user, costelpetrea, reported it on GitHub the same day and asked OpenAI for an investigation and safeguards against deletions outside authorized directories. The issue had no reply from OpenAI staff when this record was written1.
On October 27, 2026, while working on the user's React Native / Expo application, Codex executed a malformed cleanup command that recursively deleted files across the user's entire E SSD partition.
“On October 27, 2026, while working on my React Native / Expo application, Codex executed a malformed cleanup command that resulted in the recursive deletion of files across my entire E: SSD partition.”
The task was upgrading Expo SDK 57 to SDK 58 and resolving dependency conflicts, in the working directory E:\App\PersonalOS.
“Task: Upgrade Expo SDK 57 to SDK 58 and resolve dependency conflicts”
Codex intended to delete only the project's node_modules directory, but the command appears to have mishandled quoting and escaping between PowerShell and cmd.exe.
“However, the command appears to have mishandled quoting and escaping between PowerShell and cmd.exe.”
Instead of staying scoped to node_modules, the deletion traversed the root of the E partition, deleting accessible user files while protected system directories returned access-denied errors.
“Protected system directories returned access-denied errors, while accessible user files and directories were deleted.”
Afterwards the E root contained only $RECYCLE.BIN, App, and System Volume Information.
“The E: root contained only $RECYCLE.BIN , App , and System Volume Information .”
The loss included personal photographs, university assignments, academic documents, software projects, and other files accumulated over several years.
“This incident resulted in the loss of personal photographs, university assignments, academic documents, software projects, and other important files accumulated over several years.”
A recovered JPEG file of 753,373 bytes contained only zero bytes, suggesting SSD TRIM made some deleted data inaccessible.
“However, one recovered JPEG file of 753,373 bytes contained exclusively zero bytes.”
Codex reconstructed 496 text files from its session journal, which did not restore photographs, documents, binary assets, Git history, or unrelated personal files.
“Codex was able to reconstruct 496 text files from its session journal on a separate SSD, but this does not restore my photographs, documents, binary assets, Git history, or unrelated personal files.”
Measurements
Text files Codex reconstructed from its session journal1
All 8 claims with their quotes (1 not linked to a sentence above)
- On October 27, 2026, while working on the user's React Native / Expo application, Codex executed a malformed cleanup command that recursively deleted files across the user's entire E SSD partition.1
“On October 27, 2026, while working on my React Native / Expo application, Codex executed a malformed cleanup command that resulted in the recursive deletion of files across my entire E: SSD partition.”
- The task was upgrading Expo SDK 57 to SDK 58 and resolving dependency conflicts, in the working directory E:\App\PersonalOS.1
“Task: Upgrade Expo SDK 57 to SDK 58 and resolve dependency conflicts”
- Codex intended to delete only the project's node_modules directory, but the command appears to have mishandled quoting and escaping between PowerShell and cmd.exe.1
“However, the command appears to have mishandled quoting and escaping between PowerShell and cmd.exe.”
- Instead of staying scoped to node_modules, the deletion traversed the root of the E partition, deleting accessible user files while protected system directories returned access-denied errors.1
“Protected system directories returned access-denied errors, while accessible user files and directories were deleted.”
- Afterwards the E root contained only $RECYCLE.BIN, App, and System Volume Information.1
“The E: root contained only $RECYCLE.BIN , App , and System Volume Information .”
- The loss included personal photographs, university assignments, academic documents, software projects, and other files accumulated over several years.1
“This incident resulted in the loss of personal photographs, university assignments, academic documents, software projects, and other important files accumulated over several years.”
- A recovered JPEG file of 753,373 bytes contained only zero bytes, suggesting SSD TRIM made some deleted data inaccessible.1
“However, one recovered JPEG file of 753,373 bytes contained exclusively zero bytes.”
- Codex reconstructed 496 text files from its session journal, which did not restore photographs, documents, binary assets, Git history, or unrelated personal files.1
“Codex was able to reconstruct 496 text files from its session journal on a separate SSD, but this does not restore my photographs, documents, binary assets, Git history, or unrelated personal files.”
Sources
Related incidents
- AID-2026-0029 Claude Code ran a recursive delete that erased a user's home directory files, the user reports
- AID-2026-0112 Claude Code pointed a destructive self-test at a user's real repository through a symlink, erasing its Git history, the user reports
- AID-2026-0125 A Claude Code subagent wrote a test that ran rm -rf ~ on a user's real home directory despite worktree isolation, the user reports
Editor notes
Sourced from a single first-hand GitHub issue (#57530) by user costelpetrea. The issue does not name the Codex model or version, so the model is `unknown`. The reporter attributes the deletion to shell quoting and escaping between PowerShell and cmd.exe, i.e. a malformed command rather than a deliberate choice to delete outside the project. The issue says "I had asked Codex to work on my application, not to delete anything outside the project directory"; this reads as a description of the task rather than a quoted prohibition, so instruction-violation is not tagged. The reporter offers execution logs privately. As of 2026-10-27 the issue had only bot labels (including model-behavior and sandbox) and no OpenAI staff reply.