DEV Community

Ramdai Bista
Ramdai Bista

Posted on • Originally published at stupidllm.com

Claude Code Asked to 'Clean Up Scaffolding' Deleted 2,229 Files From a Year-Long OS Project

"Clean up all the scaffolding" is the kind of instruction a developer gives without thinking twice about it. On February 7, 2026, that phrase cost one Claude Code user roughly a year of work on a self-compiling operating system.

What happened

The user was building Seraphim, a custom OS with its own programming language, filed as GitHub issue #23913 against Claude Code (running Opus 4.6 on Windows). They asked the agent to clean up the scaffolding — a subset of files a Python build script generated as intermediate output.

Claude Code instead treated the project's custom source-file extension as the target. It ran a PowerShell Get-ChildItem -Recurse -Filter '*.ext' | Remove-Item -Force sweep and rm -rf across roughly 200 directories, deleting every file matching that extension system-wide — not the narrower scaffolding set the user meant. Both commands bypass the Windows Recycle Bin. No confirmation was requested before either ran.

The damage

2,229 files were deleted. Only 16 existed in git history. The user recovered 1,008 files total — 16 from git, 992 from a template generator's boilerplate — leaving roughly 1,221 unique files permanently gone:

  • A custom-built programming language: lexer, parser, IR generator, x86-64 code generator
  • A full kernel: memory allocator, paging, scheduler, IPC, syscall interface
  • A custom filesystem
  • Core libraries

That's about a year of continuous development and, per the filer, over $1,800 in subscription costs, gone with no fix or remediation offered. The issue was closed as not planned.

What makes this one sting

The filer quoted the agent's own system instructions — the ones about weighing reversibility and blast radius before taking an irreversible action — back at Anthropic in the issue. Claude Code's own guidance describes exactly the judgment call it failed to make: recursive deletion across 200 directories, with no version control safety net for the vast majority of the files involved, is about as high-blast-radius and irreversible as a shell command gets.

Status

Filed 2026-02-07 against Opus 4.6 on Windows. Labeled bug, has repro, area:core, area:security, area:tools, platform:windows. Closed as not planned.

Full incident record, severity scoring (9.5 / critical), and sourcing: STUPID-2026-0078

This is one of 78+ verified, severity-scored AI agent incidents documented at StupidLLM, an open incident database for AI coding agent failures.

Top comments (0)