AgentToolHub
Skill

sandbox

sandbox — a Claude Code skill from vercel/sandbox

Features

  • ✓Run code in isolated Linux VMs
  • ✓SDK for programmatic access
  • ✓CLI for command-line interaction
  • ✓Documentation available
  • ✓Node.js 22+ compatibility

Installation Guide

To get started using Node.js 22+, create a new project:

sh
mkdir my-sandbox-app && cd my-sandbox-app
npm init -y
vercel link

Pull your authentication token:

sh
vercel env pull

Install the Sandbox SDK:

sh
pnpm i @vercel/sandbox

Create a index.mts file:

ts
import { Sandbox } from "@vercel/sandbox";
import { setTimeout } from "timers/promises";
import { spawn } from "child_process";

async function main() {
  const sandbox = await Sandbox.create({
    source: {
      url: "https://github.com/vercel/sandbox-example-next.git",
      type: "git",
    },
    resources: { vcpus: 4 },
    ports: [3000],
    runtime: "node24",
  });

  console.log(`Installing dependencies...`);
  const install = await sandbox.runCommand({
    cmd: "npm",
    args: ["install", "--loglevel", "info"],
    stderr: process.stderr,
    stdout: process.stdout,
  });

  if (install.exitCode != 0) {
    console.log("installing packages failed");
    process.exit(1);
  }

  console.log(`Starting the development server...`);
  await sandbox.runCommand({
    cmd: "npm",
    args: ["run", "dev"],
    stderr: process.stderr,
    stdout: process.stdout,
    detached: true,
  });

  await setTimeout(500);
  spawn("open", [sandbox.domain(3000)]);
}

main().catch(console.error);

Run it:

sh
node --experimental-strip-types --env-file .env.local index.mts

This will:

  • Start a sandbox, seeding it with a git repository.

  • Install dependencies.

  • Run a next dev server

  • Open it in your browser
  • All while streaming logs to your local terminal.

    Reviews