sandbox-stable

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/sandbox.

What problem does it solve? It prevents API mismatches when working with Cloudflare Sandbox by enforcing the stable package line, so you never accidentally mix stable Worker code with @next preview APIs or container images. ## Core Features & Use Cases - Package Gate: Verifies the npm dependency and container image are both on the stable line before any code is written, and redirects to sandbox-next or sandbox-migrate-to-next when appropriate. - API Contract: Defines non-negotiable stable behaviors such as exec() command strings, startProcess/execStream for streaming, sessions for state persistence, and RPC transport preference. - Retrieval Map: Routes every task (files, ports, tunnels, backups, terminals, code interpreter, bridges) to the exact official documentation page to consult before implementing. - Use Case: You inherit a Worker using @cloudflare/sandbox and need to add background processes; the skill confirms the stable line, points you to the Background processes guide, and keeps you off preview-only APIs. ## Quick Start Ask the assistant to add a streaming command feature to your existing Cloudflare Sandbox Worker while keeping it on the stable 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(env.Sandbox, id) to obtain an instance, then call await sandbox.exec(command) with a command string. It resolves when the command finishes and returns buffered stdout, stderr, and exitCode.

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

The stable package is the current default documented in the main Sandbox docs, while @next is the 1.0 preview with a different API model. Never mix a stable Worker package with a next container image or apply @next APIs on stable.

How do I stream output or run background processes in Cloudflare Sandbox?

On the stable package, use startProcess, execStream, and related helpers rather than the @next single-handle output() model. Consult the Commands API and Background processes guides before implementing.

Can I keep shell state across commands in Cloudflare Sandbox?

Yes, sessions preserve working directory and environment across commands using the default session, enableDefaultSession, or createSession. See the Sessions concept and API docs for details.

How do I clean up deprecated Cloudflare Sandbox APIs without migrating?

Update the package and matching image first, then follow the 2026 deprecation guide to replace deprecated transports and helpers. This cleanup keeps you on the stable line and does not switch you to @next.