Agent chaosAs reported·24 Oct 2026
Codex tidies up its temp images by deleting the whole shared folder, old files and all
As reported One person’s public account. We couldn’t independently confirm it, and we’ll update this if the facts change.
A developer says Codex rendered PDF pages into a shared scratch folder on Windows, then deleted the whole folder during cleanup, taking older, unrelated files with it.
This is one person's account in a bug report on GitHub, not independently confirmed.
What happened
In a local Codex session on Windows, the developer asked the agent to analyse a scanned document. Codex rendered the pages as images into a scratch folder inside the workspace. That folder already held files and folders from earlier work.
How it went wrong
When it was done, Codex cleaned up by recursively force-deleting the entire folder with PowerShell's Remove-Item, instead of removing only the images it had just made. The report says the agent did check that the path pointed at the expected subfolder of the workspace before deleting. It just never looked at what was inside, or asked whether the folder belonged to this task alone.
The damage
The older files were untracked working artifacts. The report says they could not be recovered from Git or from any other copy in the workspace. The developer left out the path and file names, and did not record the Codex app version. At the time of writing the issue is open, and the only reply is from another user, not from OpenAI.
What the developer wants
Before any destructive cleanup, the agent should identify the exact files it created and delete only those, leaving everything it didn't make alone. If it can't tell who owns a folder's contents, it should skip the recursive delete and simply report the leftover temp files.
Our take
This is our opinion. 'The path is inside the project' is not the same as 'everything in it is mine'. Give each agent task its own fresh temp folder, and make recursive deletes ask first.
Check what's in a folder, not just where it is, before an agent deletes it.
