sandbox-stable

Build and maintain Cloudflare Sandbox apps on the stable @cloudflare/sandbox package.

1|Updated Jul 2, 2026
One-click install
npx skills add https://github.com/filippolmt/skills --skill sandbox-stable-filippolmt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sandbox-stable
Source: https://github.com/filippolmt/skills/tree/main/skills/sandbox-stable
Command: npx skills add https://github.com/filippolmt/skills --skill sandbox-stable-filippolmt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/sandbox.

What problem does it solve? Developers working with Cloudflare Sandbox risk mixing the stable npm package with preview (@next) APIs and container images, producing broken code. This Skill gates the package line, enforces the stable API contract, and routes every task to the correct official documentation page. ## Core Features & Use Cases - Package-line gating: Verifies the npm dependency and container image both match the stable line, and redirects to sandbox-next or sandbox-migrate-to-next when they do not. - Stable API contract: Enforces correct usage of exec, startProcess, execStream, sessions, terminal, and RPC transport while forbidding @next-only APIs like process.output() handles. - Documentation retrieval map: Maps tasks such as files, mounts, backups, ports, tunnels, terminals, and code interpretation to the exact Cloudflare docs page to consult before implementing. - Use Case: A developer maintaining an existing Workers app that runs Python inside a sandbox uses this Skill to confirm the stable package, stream command output with execStream, and clean up deprecated transports per the 2026 deprecation guide. ## Quick Start Ask the assistant to help you run commands and manage files in your existing Cloudflare Sandbox Worker that uses the stable @cloudflare/sandbox package.

Frequently Asked Questions about sandbox-stable

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run commands in a Cloudflare Sandbox from a Worker?

Use getSandbox to obtain a sandbox instance, then call await sandbox.exec(command) with a command string. It resolves when the command finishes and returns buffered stdout, stderr, and exitCode. For long-running work, use startProcess or execStream instead.

What is the difference between @cloudflare/sandbox stable and the @next preview?

The stable package uses exec, startProcess, execStream, and session APIs, while the @next preview introduces a single-handle model with process.output(). Never mix a stable Worker package with a next container image; use sandbox-next for new preview projects.

Can I keep shell state across commands in Cloudflare Sandbox?

Yes, sessions preserve working directory and environment variables across commands. Enable the default session with enableDefaultSession or create explicit sessions via createSession, then run commands within that session context.

How do I migrate deprecated Cloudflare Sandbox APIs without switching to @next?

Update the package and matching container image first, then follow the 2026 deprecation guide on the Cloudflare docs. Search your code for patterns like SANDBOX_TRANSPORT, exposePort(, and execStream( to find deprecated usages. This cleanup keeps you on the stable line.

When should I not use the stable Cloudflare Sandbox package?

Avoid stable when starting a brand-new project, since Cloudflare recommends @cloudflare/sandbox@next for new work ahead of the 1.0 release. Also switch when you need preview-only APIs; use the sandbox-migrate-to-next skill for that port.