/cloudflare-vm:sandboxfrom cloudflare-vm
Cloudflare Sandbox SDK: Secure isolated code execution in containers on Cloudflare's edge. Run untrusted code, manage files, expose services, integrate with AI agents.
Ships in cloudflare-vm. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Vendored from themusebook/skills (derived from cloudflare/skills, Apache-2.0). This snapshot may be outdated: confirm limits, pricing, API signatures and config options against https://developers.cloudflare.com/ before you cite them. When this file and the docs disagree, trust the docs.
When invoked: read every file in this skill's directory before answering, so you have the full reference: api.md, configuration.md, gotchas.md, patterns.md. Then answer the user's question (or, if none was given, summarise the product: what it is, config, API, patterns and gotchas). Related products are sibling skills, linked as ../<product>/.
Secure isolated code execution in containers on Cloudflare's edge. Run untrusted code, manage files, expose services, integrate with AI agents.
Use cases: AI code execution, interactive dev environments, data analysis, CI/CD, code interpreters, multi-tenant execution.
import { getSandbox, proxyToSandbox, type Sandbox } from '@cloudflare/sandbox';
export { Sandbox } from '@cloudflare/sandbox';
type Env = { Sandbox: DurableObjectNamespace<Sandbox>; };
export default {
async fetch(request: Request, env: Env): Promise<Response> {
// CRITICAL: proxyToSandbox MUST be called first for preview URLs
const proxyResponse = await proxyToSandbox(request, env);
if (proxyResponse) return proxyResponse;
const sandbox = getSandbox(env.Sandbox, 'my-sandbox');
const result = await sandbox.exec('python3 -c "print(2 + 2)"');
return Response.json({ output: result.stdout });
}
};
wrangler.jsonc:
{
"name": "my-sandbox-worker",
"main": "src/index.ts",
"compatibility_date": "2025-01-01", // Use current date for new projects
"containers": [{
"class_name": "Sandbox",
"image": "./Dockerfile",
"instance_type": "lite", // lite | standard | heavy
"max_instances": 5
}],
"durable_objects": {
"bindings": [{ "class_name": "Sandbox", "name": "Sandbox" }]
},
"migrations": [{
"tag": "v1",
"new_sqlite_classes": ["Sandbox"]
}]
}
Dockerfile:
FROM docker.io/cloudflare/sandbox:0.7.0
RUN pip3 install --no-cache-dir pandas numpy matplotlib
EXPOSE 8080 3000 # Required for wrangler dev
getSandbox(namespace, id, options?) → Get/create sandboxsandbox.exec(command, options?) → Execute commandsandbox.readFile(path) / writeFile(path, content) → File opssandbox.startProcess(command, options) → Background processsandbox.exposePort(port, options) → Get preview URLsandbox.createSession(options) → Isolated sessionsandbox.wsConnect(request, port) → WebSocket proxysandbox.destroy() → Terminate containersandbox.mountBucket(bucket, path, options) → Mount S3 storageproxyToSandbox() first/workspace for persistent filesnormalizeId: true for preview URLsCONTAINER_NOT_READYWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub vmaia00/claude-specs --plugin cloudflare-vm64 skills in this plugin
/agents-sdkCloudflare Agents SDK: Cloudflare Agents SDK enables building AI-powered agents on Durable Objects with state, WebSockets, SQL, scheduling, and AI integration./ai-gatewayCloudflare AI Gateway: Expert guidance for implementing Cloudflare AI Gateway - a universal gateway for AI model providers with analytics, caching, rate limiting, and routing capabilities./ai-searchCloudflare AI Search Reference: Expert guidance for implementing Cloudflare AI Search (formerly AutoRAG), Cloudflare's managed semantic search and RAG service.