Why I Stopped Letting Claude Code Touch My Main Drive
After Claude Code deleted half my node_modules folder during a refactor, I changed my setup. Now every agent session gets its own drive letter on Windows. What I used to do Just let Claude Code run in whatever project folder. It could read everything, write everywhere, and one bad rm -rf command could take down half my machine. The fix Map the agent workspace to its own drive letter. The agent…
Claude Code's deletion of half the developer's "node_modules" folder due to a misused "rm -rf" command led to a major change in their setup. In the past, Claude Code was allowed to freely access and modify any folder without any restrictions, which posed a significant risk. This changed when the developer began mapping the agent workspace to its own drive letter on Windows.
The agent could only see and interact with its designated drive, preventing any accidental damage to other projects or important data. This solution utilizes either a local folder or a WebDAV/cloud storage as a drive letter, offering one-time purchase flexibility. This method provides OS-level isolation similar to Docker, but without the added overhead of a virtual machine.
The advantage of this approach over Docker is its instant setup, allowing the agent to see a standard drive and utilize any tool without any hassle. It's as if this developer is safeguarding their entire system from potential disasters, ensuring that any rogue behavior of Claude Code remains confined to its own sandbox.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.