/sandbox:sandboxfrom sandbox
Run code and commands in an agent-next cloud sandbox. Use for long-running jobs, untrusted code, parallel work, anything needing a public preview URL, or heavy dependencies that should not install on the user's machine.
Ships in sandbox. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This plugin connects to the agent-next sandbox MCP server, which creates remote, disposable Linux sandboxes (E2B-compatible). Work happens in the cloud, not on the user's machine.
https://<port>-<sandbox-id>.sbx.agent-next.com so the user can see a
running web app, notebook or service.If the sandbox_* tools are missing and the server shows needs-auth,
Claude Code cached an OAuth challenge from a session started without
SBX_API_KEY: follow "API key" in the plugin README (export the key, clear
the cached entries, start a new session) instead of retrying the tools.
sandbox_create — pick a template; note the returned sandbox id.sandbox_exec to run commands, sandbox_files_write /
sandbox_files_read to move code and results in and out.sandbox_preview_url (expose a port) when the user should open a web
app or service — return the URL to the user.sandbox_kill — always destroy the sandbox when the work is done.sandbox not found: treat that as gone.timeout_min is an idle keep-alive. After that many idle minutes
(default 5, max 1440), the sandbox auto-pauses, preserving files, memory
and running processes. Activity restarts the clock; CPU usage alone does
not count. Pausing never fires before the 300 s idle floor and may land a
reaper sweep late. The next exec or files call auto-resumes an MCP-created
CPU sandbox. A full paused quota keeps it running and billing until a
paused slot is available. Continuously paused sandboxes expire after
7 days, so copy durable results out. The separate sbx CLI uses the SDK's
kill-on-timeout mode; its --timeout-min does not promise MCP auto-pause.limits.max_concurrent in
GET /v0/account (and quota_running in GET /v0/usage). A create over
the limit fails with quota exceeded, retry in 5s: kill finished
sandboxes or wait, do not retry in a tight loop.NOT_FOUND: sandbox not found, check sandboxes_list for the exact
id. If it is still running, wait a few seconds and retry once before
abandoning it (#23).
This does not apply to a missing file or job. A transport timeout or lost
reply does not prove a command failed to run: inspect its job before
repeating it.host disk nearly full ... retry in 5s means new starts are temporarily refused. Wait at least the stated
interval; do not create repeatedly or assume the key is invalid.sandbox_exec returns status: exited with
exit_code (0 included) when the command ends within wait_s (default
and max 45). If it returns status: running, exit_code is null: call
sandbox_exec_output with the same job_id until the status is
exited, and read the exit code there.nohup server > /tmp/server.log 2>&1 &, never a bare server &: a
child holding the stdout pipe keeps the call running until it exits.
Read the log with sandbox_files_read.small 2 vCPU / 8 GiB, standard 4 / 16, large 8 / 32 where
enabled), not an argument of sandbox_create.sandbox_templates for
the live catalog, then sandbox_create with a GPU template from it
(for example gpu-lease-v06 or mujoco) and vram_gb (default 4, range
0.5–32). The catalog on the live service today is gpu-lease-v06,
mujoco, browser, blender, omniverse and robotsim (sbx gpu templates lists it for the CLI); an unknown template name is refused,
and kernel is not in it.vram_gb caps the whole vGPU slice, and part of it is not yours.
Measured on a 1 GiB gpu-lease-v06 lease (2026-10-15): the device
presents 1844 MiB with 756 MiB already used at rest (the vGPU baseline),
torch.cuda.mem_get_info saw ~590 MiB free, and a fresh process's CUDA
context (~0.3 GiB) counted against the slice too, so torch.empty(500 MB)
OOMed — roughly 0.3–0.6 GiB allocatable. Rule of thumb: expect
vram_gb − ~0.4 GiB for the first CUDA process and ~0.3 GiB less per additional CUDA process, and size the
lease for workload plus that overhead, not for the workload alone.none;
internet works only on nodes the operator opted in, and a create that
asks for it elsewhere is refused with HTTP 400 (gpu egress disabled on ...). Do not plan pip, dataset or model downloads. Bring code and data
in over REST instead: PUT /sandboxes/{id}/files/{name} (raw body, 512 MiB
cap by default) writes into the job's OUTPUT_DIR, where the job can read it.suspend_mode: "none" template (the docs' words: it "keeps its seat and bills its whole
residency") bills every second of its lifetime — measured billed seconds
equal running seconds on an 18.7 s mujoco lease — while the default
torch template bills busy time only. Create, work, then kill without idle
gaps for mujoco and blender. GPU sandboxes support sandbox_exec
and sandbox_kill, consume separate GPU credit, and have a hard VRAM
cap. They cannot expose preview URLs or use the MCP files tools (use the
REST files endpoints above).mujoco and robotsim templates —
import mujoco_warp, warp, mujoco.mjx and mujoco_playground all
succeed on the live service. The templates' offline package tree has no
dist-info, so pip list and importlib.metadata do not list these
packages: test them with an import, not with pip list.sbx gpu CLI a GPU lease can also pause and resume between
jobs. Suspend behavior depends on the template and live plane;
mujoco can freeze despite suspend_mode:"none". Do not infer capacity
release or stopped billing from that field alone. An exec against a
transparently suspended lease can be refused with HTTP 503
GPU plane at capacity while its resume path waits for a free seat
(measured: retry in 6s); retry after the suggested delay, like the
other gateway retry hints. timeout_min is
validated but not applied (timeout_min_applied: false): kill them
explicitly when done. Their maximum lease age appears as end_at in
sandboxes_list.sbx CLI (key needs a GPU grant):
id=$(sbx gpu create --vram 4) # prints gl-... ; add --template NAME (sbx gpu templates)
sbx gpu exec "$id" -c 'import torch; print(torch.cuda.get_device_name(0))'
sbx gpu exec "$id" --code job.py --json # report dict + meters; exit 1 if the job raised
sbx gpu pause "$id"; sbx gpu resume "$id" # pause/resume between jobs
sbx gpu kill "$id" # always; `sbx gpu info "$id"` shows billed_s
https://<port>-<sandbox-id>.sbx.agent-next.com can reach the port, with
no sign-in, and it answers 502 after the sandbox is killed. Do not serve
secrets or admin tools on a preview port. To restrict it, create the
sandbox over the REST API with network.allowPublicTraffic=false (or
register the port public:false); sandbox_preview_url then returns a
token to append as ?_gw_token=<token>.sandbox_exec stdout/stderr are capped at 256 KiB per stream, plus
truncation markers; truncated results include stdout_file / stderr_file
paths. sandbox_exec_output returns at most 100000 bytes per stream per poll.
Read full text files with sandbox_files_read (no offset/limit arguments),
or page them with shell commands.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub agent-next/sandbox --plugin sandbox