Two Preview Modes, Two Different Jobs
When you first open a project in CloudCode, you will notice two tabs in the preview panel: Dev and Live. They look similar — both show your running application in a browser viewport — but they serve fundamentally different purposes, and understanding when to use each one will make your development workflow significantly faster.
The short version: use Dev (Sandpack) while you are building. Use Live when you need to see exactly what your deployment does.
What Is the Dev Preview?
The Dev preview runs your application inside Sandpack — the in-browser JavaScript bundler from the CodeSandbox team — which bundles and runs your project files inside an iframe in your browser tab. Your code runs in your browser rather than on a CloudCode server, and npm packages listed in your 'package.json' are fetched from Sandpack's CDN. There is no 'npm run dev' process to start on a remote machine.
This architecture gives you three properties that matter enormously during active development:
Fast feedback. When the Claude Code agent makes a change to your code — or when you make a change manually in the editor — the Dev preview recompiles about half a second later. You edit; you see.
Nothing to start. There's no dev server to boot and no container to wait for. React projects in TypeScript or JavaScript run straight away, and projects without React are previewed as static HTML. If 'index.html' or 'main.tsx' is missing, CloudCode generates an entry point that renders 'src/App'.
Instant availability. You do not need to click any button to start the Dev preview. It reflects the current state of your code, and when it hits a runtime error, an overlay with an Auto-Fix button appears.
What Are the Limitations of the Dev Preview?
Sandpack is great, but it is not a Node.js runtime. It cannot execute server-side rendering, API routes, or any code that needs 'fs', 'child_process' or a server. Tailwind's PostCSS build doesn't run there, so load Tailwind's CDN script if you need Tailwind styling in the Dev preview. Network requests are subject to CORS, and large packages can be slow on first load.
What Is the Live Preview?
The Live preview embeds your most recent successful Vercel deployment. When you click the Deploy button in CloudCode, your project is deployed to Vercel and assigned a '*.vercel.app' URL. The Live tab loads that URL in an embedded browser viewport.
This is not a simulation. The Live preview shows exactly the files that were deployed, served by Vercel. Its Console drawer shows console output and uncaught errors from the deployed pages, and its Network drawer records each fetch request's method, URL, status and duration.
When to Use the Live Preview
Use the Live preview when you need to verify what Sandpack cannot show you. OAuth and third-party authentication flows need a stable, registered URL — your deployment URL can be added to your provider's allowed redirect list. A small Express API deployed as a Node.js App runs as a real Vercel serverless function. And when you are sharing work with a client or stakeholder, send them the deployment URL — it's a shareable link that works on any device.
Keep in mind that the Live preview doesn't hot-reload: after you or the agent change files, deploy again and refresh.
The Recommended Workflow
The most efficient CloudCode workflow uses both preview modes in combination:
Build with Dev. Use the Dev preview for all active development. The instant feedback loop — edit, see, iterate — is where you will spend most of your time.
Deploy to verify. When a feature feels complete, click Deploy and check it in the Live preview. Look for any discrepancies between how it looked in Sandpack and how it behaves on Vercel.
Fix with Dev, redeploy. If you find issues in the Live preview, switch back to Dev to fix them quickly, then redeploy.
This loop — Dev for speed, Live for accuracy — keeps your iteration cycle fast while ensuring you never ship something that only worked in a sandbox.
Deployments don't cost credits, so you can deploy as often as you need to verify your work. Use the Dev preview for most of your iteration, and deploy whenever you want to check the real thing or share a link.
