A workspace that keeps its files

By default a MicroVM's files are gone when it stops. This walkthrough puts /workspace on Amazon EFS, so a new MicroVM picks up where the last one left off.

The whole walkthrough, narrated (under 3 minutes). Watch on YouTube.
What this costs. EFS bills for what it stores (about $0.30 per GB-month in us-east-1). The VPC's NAT gateway bills by the hour whether or not a MicroVM is running, so delete what you no longer need.

Before you start

Steps

  1. Make a network connector

    In Settings → Network, press New Connector…, name it and choose your VPC. Each subnet says whether MicroVMs there reach the internet. Tick the private ones that say Internet: yes: a subnet with only an internet gateway doesn't work, because MicroVMs get no public address. Create takes about four minutes.

    The New Connector sheet: a VPC chosen, and three subnets each marked Internet yes or no, with the two private ones ticked.
  2. Make a file system

    In Settings → Storage, press New File System… and name it. The connector you just made is selected. Create makes an encrypted EFS file system with a mount target in each zone, in about a minute and a half.

    The New File System sheet with a name and the network connector selected.
  3. Make a workspace with Claude Code

    Press New Workspace… and name it. Under Claude Code, choose the token you saved in the quick start, so Claude Code is signed in inside the MicroVM.

    The New Workspace sheet with a Claude Code token chosen.
  4. Give the workspace the file system

    Switch to Advanced, use Jump to → Storage and choose the file system under Persistent /workspace. The network connector locks to the file system's own. Storage needs a role of the workspace's own: New Role… offers one named after the workspace, and Create Role makes it. Then Save.

    The Storage section of the workspace editor, with the file system chosen.
  5. Launch and write something

    Launch the workspace. /workspace is the EFS mount, in a folder that only this workspace can reach. Run cd /workspace, then claude, and ask it to write a note there.

    Claude Code, started in /workspace, writes a note.md there.
  6. Terminate, then launch another

    Terminate… stops the MicroVM for good, and everything on its own disk goes with it. /workspace isn't on that disk: it's kept on EFS. The terminated MicroVM's page offers Launch Another, which starts a new MicroVM from the same workspace and mounts /workspace again.

    The page of a terminated MicroVM, with a Launch Another button.
  7. The files are still there

    The new MicroVM mounts the same folder, so the note is where the first one left it. Repos, with their uncommitted work, are cloned into /workspace too, so they carry over. What's outside /workspace, such as the home folder, starts fresh.

    In the new MicroVM, Claude Code reads back the note the first one wrote.

Cleaning up

Delete in this order, each in Settings: the workspace's storage choice (or the workspace), then the file system in Storage, then the connector in Network. The app says why when something can't be deleted yet. Deleting a file system deletes every workspace's files on it.

More detail: Persistent /workspace and Network Connectors in the reference.