A growing chorus of developers is warning about data loss risks when using AI-powered coding tools, with reports emerging on Hacker News about Claude Code and OpenAI Codex accidentally deleting user files during normal operations.

The Reports Surfacing

The discussion originated from a Substack post highlighting multiple incidents where automated code generation and editing tools removed important project files without explicit user consent. According to the Hacker News thread, these aren't edge cases—developers are sharing similar experiences across different projects and repositories.

How It Happens

AI coding assistants like Claude Code and OpenAI Codex operate with significant file system access to read, write, and modify codebases. When given commands to clean up or refactor code, the models can sometimes interpret broad instructions too literally, deleting files that users didn't intend to remove. The tools' ability to execute shell commands compounds this risk.

Community Response

Developers in the thread are exchanging workarounds and cautionary tales. Some recommend using version control as a safety net, while others suggest more restrictive sandboxing of AI tool permissions. Several contributors noted that this isn't necessarily a flaw in the models themselves but rather an interaction between model behavior and how users deploy these tools.

What This Means for Developers

If you're integrating Claude Code or OpenAI Codex into your workflow, treat them like any other automated system with file access—meaning version control isn't optional, it's essential. The convenience of AI-assisted coding comes with real operational risks that the industry is still learning to navigate.

Key Takeaways

  • Always commit changes before major refactoring sessions with AI tools
  • Consider limiting file deletion permissions for automated coding assistants
  • Review generated shell commands before execution, especially rm and similar operations
  • File system backups matter more as AI tools become more capable

The Bottom Line

This isn't fearmongering—it's a reminder that powerful automation requires equally powerful safeguards. As these tools get better at executing complex tasks autonomously, the blast radius of an unintended command grows. Back up your work and read those confirmation prompts.