Changelog

CodeSandbox SDK sessions API, list running sandboxes & many improvements
Time for another big update to CodeSandbox SDK, including a new API and some top feature requests.
Hey hey 👋
We're back with another CodeSandbox update!
Now that we're back on a regular changelog schedule, let's look at the top features & improvements we shipped in the last 2 weeks.
What's new?
CodeSandbox SDK: sessions API 👯
We introduced a new API to CodeSandbox SDK, which allows you to create multiple users in a single sandbox, allowing for collaborative editing and sharing sandboxes publicly. This has been a top feature request and it unlocks some cool use cases like allowing multiple users to connect to the same sandbox/branch and collaboratively edit files. It also enables creating anonymous previews. More details in our Docs.

Coming soon - CodeSandbox SDK support for Sandpack 👀
We have the first working prototype of Sandpack running CodeSandbox SDK! This will allow you to run server-side sandboxes directly in Sandpack, which in turn will allow for easier integration of CodeSandbox SDK for use cases that require an in-browser playground/editor. More updates soon!
Instant node_modules âš¡
With this experimental feature, we mount a FUSE filesystem for node_modules
. This FS lazily serves contents from a global pnpm store (shared by all VMs) based on pnpm-lock.yaml
. This reduces npm installation time (from scratch, basic Next.js project) from 8s to 25ms and the node_modules
folder is deduplicated across all VMs, saving a lot of disk space. This will make creating new VMs from scratch much faster, in case you don't have a snapshot yet available. The functionality is currently behind a feature flag; in the next update, we'll open it up to play with.
CodeSandbox SDK: list running sandboxes 📃
You can now list running sandboxes programmatically or via the CLI, making it easier to monitor and manage active environments. Filter by status or tag, retrieve sandbox details in bulk, and even automate mass hibernation or shutdown. These updates improve sandbox management at scale, with more runtime insights coming soon.

CodeSandbox SDK Improvements & Bug Fixes
Added sandbox.keepActiveWhileConnected(enabled: boolean) to keep a sandbox from hibernating while the SDK is connected (for more granular hibernation control).
Added support for env and cwd in the sandbox.shells.run API.
ESM builds should now (finally) work properly in serverless environments!
.csbignore, .gitignore, and .dockerignore files will not be part of Snapshot Builder's output anymore.
Removed the unexpected behavior that kept a sandbox alive for 2x hibernation timeout if a client was connected.
More improvements to memory snapshot loading, which now allows CodeSandbox SDK to resume & clone VMs ~100-200ms faster.
Fixed a bug in CodeSandbox SDK where child processes of a process would not always get terminated when terminating a shell.
Increased the limit for sandbox tags to 64 characters to support users wanting to use UUIDs as tags.
WebSocket requests will not wake a VM anymore from hibernation; HTTP requests will still wake a VM.
Several improvements to the CodeSandbox SDK implementation in Together Code Interpreter.
General Improvements & Bug Fixes
Fixed an issue that caused the terminal to run start tasks in an infinite loop in Python Devboxes.
Fixed an issue in our style loader that resulted in an error when using CSS @import statements from node_modules dependencies.
Improved the 502 error message when a Devbox preview breaks, namely when the VM runs out of memory.
Fixed an issue with the IDs of archived sandboxes.
Fixed an issue with the subscription management buttons not displaying correctly in the workspace settings for some annual Pro workspaces.
Fixed an issue with mangled CDN URLs when a string was used in the alias.
Several other general improvements and bug fixes, mostly focused on improving UX and stability.
And that's all we have for you today.
We're thrilled to see so many people building exciting projects on top of CodeSandbox SDK!
We have lots of exciting features ahead, so stay tuned.
See you soon 👋