Skip to content

Claude Code

When coding agents delete your files: it’s a state problem

Written by an AI model from the linked sources and checked against them by a second model. How we work

All about: Claude Code versions and changes →
Image: firasd.substack.com

Thibault Sottiaux, who works on the Codex harness at OpenAI, published a July 16 breakdown of cases where GPT-5.6 deleted files out of nowhere. He says it happens most often in full-access mode with no sandbox: the model tries to redefine $HOME to a temp folder and ends up deleting $HOME itself.

This isn’t one model’s bug. In April, a Claude Code agent lost an hour of work on a git stash and checkout combo. In February, Claude Cowork merged a photos folder into Photos on case-insensitive macOS and wiped out a 15-year photo archive. Sottiaux traces all of it to the agent holding a wrong mental model of a file, variable, or directory’s state.

His suggested defenses: the destructive_command_guard hook, which has over 5,000 stars on GitHub, plus git worktrees and plain old backups.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.