devvm agent import and save checked each path they wrote in the store by path (storeGuard), then wrote by path (os.MkdirAll, state.WriteFileMode), so a link swapped into the store between the check and the write could lead the write elsewhere. They still check every path first, so a link fails the command, naming it, before the store changes; they now write only through the agent's folder in the store opened from devvm's config folder as a root (makeStoreDir, which makes it and the folders on its way through the config folder as a root, then openStoreDir), with state.WriteFileIn, a whole-file write through an os.Root. An import copied whatever an agent's folder held, one file at most 128 MiB, so a VM whose project folder is inside an agent's folder could fill the store that every VM with the agent mounts. Each agent's folder now gets agent save's bounds in all, 20,000 files and folders and 128 MiB: the walk stops at 20,000 (errFolderTooMany), the sizes as listed are counted (hostAgent.tooMuch), and a folder over either fails the import before anything is written, naming the folder and what to do (agent_import_too_much); the files' reads share the 128 MiB (h.read), so files that grew since the listing fail too. Before it reads anything, the import warns of each VM whose project folder is inside an agent's folder or holds it (agent_import_project_inside). A project folder that holds an agent's folder, such as ~/.pi for pi's ~/.pi/agent, let its VM put a link in the agent folder's place, which the import followed, copying whatever it led to, such as the home folder's files, into the store: the import now resolves the folder's path one link at a time (linkHops), leaves it out with agent_import_link_via_vm when a link in a VM's project folder leads it out of that folder (throughVM, shared with the link follower), its login with it (pi's auth.json), and reads the folder where the path led. Every agent's login file but Claude Code's ~/.claude.json, which was already a capped, regular-file read, was os.ReadFile by path, so a VM whose project folder held it could swap in a link to another file, a FIFO or an endless file between the check and the read: its path is now resolved once (linkHops), left out when a link in a VM's project folder leads it out of that folder (throughVM), and read where it led, through its folder opened with no link and never resolved again (openPhysical), opened without following one, a regular file of at most 128 MiB (claudeHostLogin), so a folder swapped for a link since fails the read. Tests: TestWriteFileIn, TestAgentImportTooMuch, TestAgentImportReadBudget, TestAgentImportProjectInside, TestAgentImportProjectHolds (a folder and a login led elsewhere), TestAgentImportLoginNoFollow, TestStoreOpsRefuseLinks (makeStoreDir). Co-Authored-By: Claude Opus 5.5 <[email protected]>
One VM for every project
An isolated sandbox with your project's toolchain, ready for you or a coding agent to start coding.
Install · Read the docs · Staying safe
Install
On macOS, install devvm with Homebrew, which also installs Lima:
brew trust --formula devvmhq/tap/devvm
brew install devvmhq/tap/devvm
On Linux, install it with the install script, which also works on macOS and asks before it installs Lima, QEMU or access to /dev/kvm:
curl -fsSL https://github.com/devvmhq/devvm/releases/latest/download/install.sh | bash
Then run devvm doctor, which checks what devvm needs on your machine and says how to get anything that's missing.
Each release is signed with devvm's minisign key, RWSjzFsn7ETaijKJ2y7F4DtZobXmyv+LmdclJwZP/KmAkLUwOCzWF/2b, and Checking the install script shows how to check the script with it before you run it.
- Requirements: macOS 13 or newer, or Linux, on arm64 or x86_64, with Lima 2.2 or newer (Lima's requirements).
- Tested on Apple silicon Macs and on Linux on arm64 and x86_64, but not yet on Intel Macs.
- Installing has the full list of requirements and the install script's options, and Upgrading and uninstalling covers what comes later.
Quick start
cd ~/some-project
devvm
- Go to your project. Open a terminal and
cdinto any project folder. - Run devvm. It shows what this folder's new VM gets, with the toolchains your project's files call for. Confirm to make the VM, or customize it to choose its toolchains, coding agents, layers, network tier and size.
- Start your agent. devvm opens a shell in the VM, at the same path as on your machine, and its prompt starts with
(devvm), so runclaudethere.
- Running
devvmin the folder again opens the same VM. - Your first VM has the rest.
Note
The first run starts with a few questions that set devvm's defaults for every new VM and its base image: the size and coding agents new VMs get, and the base image's optional extras. It builds the base image once, in a few minutes. Later VMs start in seconds.
Tip
Claude Code needs your Claude login before its first start, which
devvm agent login claudemakes from the VM and keeps on your machine (Claude Code's login).
What's supported
- Toolchains: devvm detects them from the project's files, so a folder with
package.jsongets node, and the toolchains page lists them all. - Coding agents: Claude Code, Codex, opencode, pi and Cursor CLI run in the VM, with your settings, skills and MCP servers. devvm keeps their settings and logins in a store of its own, and
devvm agent importcopies them in from an agent you already use on your machine (coding agents). - Layers: the built-in
docker,nixanddesktoplayers, and your own fromdevvm layer new(layers). - Backend: devvm runs its VMs on Lima (backends).
Why use devvm?
- Isolated: each project folder gets a VM of its own, which mounts only the project folder, at the same path as on your machine (what a VM can reach).
- Network tiers: new VMs get the allowlist tier by default, so they reach only the hosts you allow (network tiers).
- Secrets stay home: on every tier, your secrets, such as your GitHub token and Claude Code token, stay on your machine.
- Agents in the sandbox: you start the agent in the VM's shell, so you never install it on your machine.
- Ready in seconds: every VM is a copy of a base image, and toolchains are shared read-only between VMs (images).
- No sandbox closes every gap: a few habits close most of what devvm can't close on its own, so read Staying safe before you trust a VM with a project.
Working on a clone
By default, the VM mounts your project folder, so the VM and your editor share the same files. With devvm --clone, the VM gets a clone of the repo of its own, so nothing in it can touch your working tree or .git, and its work reaches your repo only when you fetch it:
devvm --clone # make the VM with its own clone, and open a shell in it
git fetch devvm # later, on this machine, fetch the VM's work as devvm/<branch>
git log -p main..devvm/main # review it before you merge it
Working on a clone has the details.
Docs
The docs are at devvm.dev, and their source is in docs/.
- Getting started: installing devvm, your first VM and the commands you use most.
- Using devvm: images and tools, clones, links between VMs, ports and size, coding agents, SSH and editors, and troubleshooting.
- Staying safe: the habits that keep you safe, network tiers,
.gitprotection and attack vectors. - Backends: Lima, which runs the VMs, and what it gives them.
- Compared to other tools: how devvm differs from Docker Sandboxes and other sandboxes.
- CLI reference: every command, with its arguments and flags.
- How it works: how devvm does what it does, for checking a claim or reviewing its security.
- Contributing: building, testing and writing docs.
Security and contributing
- Report a vulnerability as SECURITY.md says.
- CONTRIBUTING.md and the Contributing pages cover building, testing and writing docs.