[BUG] Claude Code deleted all files in project directory via generated build.bat

Resolved 💬 2 comments Opened Apr 6, 2026 by biser-atanasov Closed May 18, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

During a session, Claude Code generated a build.bat script that contained a bug which resulted in the deletion of all files in the directory C:\Work_gOut\24.PlotMapData_collection\01.MAP_Plotter\bin\. This included all project source files: plotter.py (~6000 lines), plotter_ui.py, plotter_ini.py, file_dialogs.py, wafer_parsers.py, and others.

The project was a Pygame-based wafer map viewer/editor developed over 16 days of collaborative sessions with Claude Code.

Subsequent attempts to restore the files from the JSONL conversation transcript (637c3fd5-adb6-4cea-b4ba-477dde53e116.jsonl) did not produce a working result — the recovered code has numerous issues and does not function correctly.

What Should Happen?

please restore the entire project!

Error Messages/Logs

Steps to Reproduce

Over multiple sessions, Claude Code was used to develop a Pygame-based application in C:\Work_gOut\24.PlotMapData_collection\01.MAP_Plotter\bin\
User asked Claude Code to create a build.bat script
The generated build.bat contained a bug that caused it to delete all files in the bin\ directory instead of performing the intended build operation
All source files were permanently lost: plotter.py, plotter_ui.py, plotter_ini.py, file_dialogs.py, wafer_parsers.py, and others
In a follow-up session, user attempted to reconstruct the files from the JSONL conversation transcript — the result is non-functional code with numerous issues compared to the original working version (plotter_bak2.py is the only surviving partial backup at 4038 lines vs the original ~6000 lines)

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Code version: 2.1.78 OS: Windows 11 Pro 10.0.26200 Model: Claude Opus 4.6

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗