How not to have your hard drive deleted by AI

date
Jan 9, 2026
type
Post
year
slug
ai-container
status
Published
tags
AI
Claude Code
Console
Docker
Linux
Shell
bash
summary
You’ve probably all heard the stories: AI coding tools wreck havoc on users’ machines, delete entire hard drives, then apologise profoundly.
You’ve probably all heard the stories: AI coding tools wreck havoc on users’ machines, delete entire hard drives, then apologise profoundly.
notion imagenotion image
Maybe it wasn’t such a good idea to give AI tools access to our command lines and let them do whatever the hell they wanted?
Well, it’s easy to prevent this drama. How? I run my AI agents inside a docker container! It’s not even inconvenient, because I have a volume mounted into a folder on my Mac. That’s the only point of contact. The AI agent can’t touch or run anything on my computer, but the project files still end up in that one special folder on my drive for easy testing.
I made a shell script that starts everything up for me - I just run ./ai-sandbox.sh start and a docker image builds, installs everything I need and connects me the shell inside the docker container!
notion imagenotion image
It doesn’t look any different from using Claude Code (or anything else) directly in the terminal. Except here I don’t need to worry about anything. If it messes up the system in the container, I just run ./ai-sandbox.sh rebuild and it’s ready to go again!
If I want to work on multiple things at once, I just open a new Terminal window and run ./ai-sandbox.sh shell and it connects me to another shell instance inside the container!
notion imagenotion image
I shared this little project ⬇️ on GitHub here, so feel free to use and mod to your liking. All you really need is Docker Desktop installed.

Leave a comment