Uses Apple's native, open-source container tool to isolate Claude Code in a Linux VM tied to a workspace.
Features:
- Isolated: Claude can't access files outside the project it's working on.
- Performant:
containeris optimized for Apple Silicon. - Resumable: Claude memory and session state are saved per-workspace.
- Personal:
moatsessions use your host's Claude settings.
Warning
container doesn't support network firewalling, so Claude Code in the VM will have full network access. Take care as to the contents of the directory you give to moat.
Warning
Claude Code has passwordless sudo inside the container so it can install whatever tools it needs. Note that VM instances are transient (run with --rm), so tool installs don't persist across moat sessions.
Before running moat for the first time, you need to install some stuff.
-
Install
containerfrom Github Releases, using the.pkginstaller. -
Install Rosetta. Required because something in the
container buildpipeline requires Rosetta installed, even if you're building for arm64.
softwareupdate --install-rosetta --agree-to-license-
Run
container system start. This will prompt you to install a default kernel. -
Build
moat's VM image. From this directory:
make imageNote
To update moat's version of Claude Code, rebuild the image.
Note
The default image is moat:base. See images/ for others, and --image to use them.
- Install
moatitself. Downloadmoat-<version>-macos-arm64.zipfrom Releases, unzip it, and add it to yourPATH.
Alternatively, build moat from source. From this directory:
make
./moat # symlink to the built productSee Moat.xcworkspace to open all the various packages in here at once.
For releasing, see MoatRelease/ and make release.
moat <path-to-repo>For full config options, see:
moat --help
To generate completions for moat for a given shell (such as zsh), run:
moat --generate-completion-script <shell>You can use this to add moat completions to your shell by adding the following to your shell config:
source <(moat --generate-completion-script <shell>)