Skip to main content
This example installs a pinned Claude Code release inside a Node.js microVM and opens it in a project mounted from your host. Claude Code can edit the checkout directly, while its installation, authentication, settings, and sessions stay on the sandbox’s root disk.

Run Claude Code

1

Start Claude Code

Replace ./my-project with the project directory you want Claude Code to work on:
Choose a terminal theme, then follow the sign-in prompts. If Claude Code cannot open a browser from the microVM, copy the displayed login URL and open it in a browser on your host.Anthropic recommends its standalone installer for normal host installations. This example uses the pinned npm package for a reproducible sandbox setup; the package installs the same platform-native Claude Code binary.
For an isolated workspace, or when using microsandbox cloud, replace --mount-dir ./my-project:/workspace:rw with --copy-dir ./my-project:/workspace.
2

Start another session

After leaving Claude Code, return to the same sandbox and workspace with:
The sandbox root disk retains Claude Code’s authentication, configuration, and conversation state between sessions.
3

Verify the installation

Exit the TUI and run:
The pinned example prints 2.1.235 (Claude Code).
4

Review or export changes

With the default writable mount, changes are already in the host checkout. Review them inside the sandbox:
If you chose the isolated --copy-dir alternative, create a patch inside the sandbox:
Copy the patch to the host:
Check that it applies cleanly before applying it:
5

Clean up

Remove the sandbox:
Removing the sandbox also removes its Claude Code credentials, settings, and sessions. Changes made through the default workspace mount remain in the host checkout.

Reference