Since Claude Code can execute arbitrary shell commands it's a good idea to run it isolated from the rest of the computer.
On a mac, assuming you have homebrew already installed:
- Install docker / colima in case you haven't it already
brew install colima docker
brew services start colima
colima start --arch aarch64 --cpu 2 --memory 4 --disk 100
- Create a debian bookworm instance
docker pull debian:bookworm
docker run -it --name debian-sandbox --hostname debian-sandbox --restart unless-stopped -v ~/Documents/ai-coding:/mnt/ai-coding debian:bookworm bash
- Start the Sandbox
docker start -ai debian-sandbox
- Connect to a running sandbox
docker exec -it debian-sandbox bash
- Stop the Sandbox
docker stop -ai debian-sandbox