That dangerous permission mode I showed you in the last lecture clearly
has some potential problems. You don't wanna erase your hard
drive. That's why there also is a safer way of running Claude
in that mode, at least if you have Docker installed.
Because if you do have Docker installed and up and running on your
system, you can use Dockers sandbox feature,
relatively new, which allows you to run things,
tools in an isolated sandbox that's set up on the
fly on your system by Docker. And you can specifically use Docker
Sandbox to run Claude, to run Claude Code in this
project in a sandbox. And what this will do is it will
now set up a Docker Sandbox, wrap your
local project you're working on in that sandbox, and
use Claude Code in that sandbox to then start it in there.
And it will, by default, start it in this dangerous
skip permissions mode because in that sandbox, Claude
Code can't touch your computer, your system.
Even if it wrote a script that erased the hard drive, it wouldn't be
able to go out of that sandbox. It would be limited to this
project. And that, of course, is therefore a safer way of running
it. Sure, it can still do weird stuff to your Git
all that, so that's something to be aware of,
overall machine. So when running this, I have to go through that setup
again and connect again because it is a brand-new
system in the end for Claude Code in which it's now running.
And as you see, it by default runs in this bypass
in that sandbox. So I can again ask it
for changes and then to commit those changes, and it will still be
able to do that. It's still able to work on this project
to edit the files in this project but even
theoretically, it won't be able to do anything outside of
project. And you can, therefore, use Claude in the Docker
Sandbox just as you can use it outside of it.
It's just a bit secure when using this dangerous
permission mode here. You can also use all those Claude CLIs
I showed you before and you find in the official
or dash P.