Offloads code execution, builds, tests, and multi-machine clusters to ephemeral CreateOS Sandboxes via the `cos` helper. Use for untrusted code, heavy workloads, remote dev servers, port tunnels, HTTPS preview URLs, graphical Linux desktops, or delegating tasks to other agents.
Ships in createos-sandbox-codex. 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.
Read when SKILL.md points to them.
A CreateOS Sandbox is an isolated Linux box that goes from create to running your first command in roughly 200 ms. Use it as throwaway compute instead of running risky or heavy work on the user's laptop.
Everything goes through cos. A session-start hook prints its absolute path into your context at the start of the session — use that literal path.
In Claude Code specifically, do not write ${CLAUDE_PLUGIN_ROOT} into a Bash command. That variable is set when slash commands are loaded but is unset in the Bash tool's environment, so the path collapses to /scripts/cos and dies with exit 127.
If you cannot locate or run cos, stop and say so. Do not fall back to composing the job out of raw createos sandbox create/push/exec calls. That path looks equivalent and is not: it silently drops egress restriction, the keepalive that survives a dropped stream on a long build, guaranteed auto-destroy, and the auth preflight — so a "successful" run can leave an unrestricted box billing with no isolation ever applied. A missing driver is a hard stop, not a reason to improvise.
cos install symlinks it into ~/.local/bin if the user wants it on PATH permanently. It wraps the authed createos CLI and needs jq, tar, perl, and curl; if the createos CLI is missing it auto-installs it from the official script (opt out with COS_NO_AUTOINSTALL=1).
cos auth
Healthy output names one of three credential sources: CREATEOS_API_KEY, a browser OAuth session, or an API token file. Anything else means not signed in.
The session-start context already reports the CLI version/path and sign-in status: at session start cos setup installs or upgrades the CLI and, if signed out with tmux available, starts createos login in a hidden tmux session (createos-login) that opens the user's browser on the CreateOS sign-in page. If sign-in is pending, tell the user to finish it in their browser, then re-check with cos auth. You may re-run cos setup if that session is gone.
Do not run createos login yourself — it is an interactive TTY prompt and an agent shell has no TTY. Do not work around it with --token. Otherwise relay the options to the user:
createos login in their own terminal and pick "Sign in with browser".export CREATEOS_API_KEY=<key> (from https://createos.sh) in the shell that launched the agent, or tmux kill-session -t createos-login, run createos login themselves and pick "Sign in with API token".Never ask the user to paste an API key into the conversation — it lands in the transcript. Export or browser, nothing else.
Every cos command except install, setup and auth runs this check first, so an unauthenticated box never gets tarballed and uploaded before failing.
| Situation | Why offload |
|---|---|
| Untrusted / unknown code — a snippet, a fresh npm/pip package, scraped code, a PoC exploit | Isolation. The blast radius is one disposable box, not the laptop. One file → exec. |
| Any ad-hoc script — a one-off Python/JS/shell/Go snippet to compute, parse, probe or try something | Keep the laptop clean; exec runs it remotely and returns stdout, stderr and the exit code. |
Heavy build or test suite — big make, full test run, compile, benchmark | Keeps the laptop free; runs on a box sized for it. |
| Parallel/matrix work — same job across N configs, test shards, batch | fanout — each command in its own throwaway box, concurrently, results collected. |
| Quick scratch Linux — try a CLI/tool/snippet on a clean box | shell — instant keyless box, destroyed on exit (interactive; the user runs it). |
| Clean-room repro — "works on my machine" bugs, dependency conflicts | Fresh rootfs every time, no host state. |
| Live dev loop — dev server / test watcher / REPL that reacts to edits | Project box + sync; you edit locally, the box reacts. |
| Reach a box-side service — dev server, DB, API | tunnel (private, to 127.0.0.1) or expose (public HTTPS link to share). |
| Needs a screen — a real browser, a GUI app, or a desktop to click through | desktop — graphical box + noVNC URL; computer to drive it (screenshot/click/type). |
| Multi-machine — distributed system, DB replication, p2p mesh, load test | cluster up N — boxes share one private net, reach each other by name. |
| Same setup, many variants — try N branches from one prepared box | fork the project box into independent clones. |
| Repeated identical setup — every offload starts with the same install prelude | template — bake the toolchain into an image once. |
| Done for now, back tomorrow — warm box you don't want to rebuild | pause — snapshot at zero compute cost, resume restores it exactly. |
| Hand the work to another coding agent — second opinion, long refactor, untrusted repo | agent — claude/codex/opencode/pi/cursor run in a box, on any provider. |
| Big data / weights / shared cache | disk — BYO S3 bucket mounted into the box, survives box death. |
Do NOT offload trivial commands, anything needing the user's local secrets/SSH/cloud creds, or work that must touch real local filesystem state.
Almost every task is one of two shapes, and picking the wrong one wastes a lot of motion:
cos offload <dir> <cmd>. One command. It creates the box, ships the directory, runs, and destroys the box. Nothing to clean up.cos exec <file> (or cos exec -l py - with the code on stdin). No directory to stage.cos up, then run/sync, then pause or down.If you find yourself doing any of the following, you have picked the wrong shape and should stop and use offload instead:
cos up for a task that has a clear finish linepush-ing files into the box by hand — offload stages the directory for you, with sensible excludes, in the same commandcos status to decide what to do first — for one-shot work there is nothing to check, just offloadcos run takes the command as one plain string. There is no -- separator: cos run 'npm ci && npm test'.
Stage a directory, run, optionally pull artifacts back, always auto-destroys. Flags come before the <dir> <cmd> positionals.
# run a test suite off-machine (the preset opens the registries it needs)
cos offload -p python-uv . 'uv sync --frozen --group dev && uv run pytest -q'
# Python + Rust, compose presets, exclude build dirs, pull artifacts back
cos offload -p python-uv -p rust-cargo -x target -o dist . 'uv sync --frozen && uv run pytest -q'
# trusted heavy build, explicitly unrestricted egress
cos offload -E -s s-2vcpu-2gb . 'cargo build --release'
# untrusted script, outbound locked to exactly what it needs
cos offload -e pypi.org -e files.pythonhosted.org ./suspect 'python3 main.py'
Two things about this that are easy to get wrong:
cos prints a one-line notice. Restricting is opt-in with -p <preset> or -e <domain>. So "run this untrusted thing in a sandbox" is only half done until you pass one of those.-o <path>. .git, node_modules, target, .venv and friends are excluded from the upload by default — dependencies are meant to be built inside the box.Long, quiet builds survive a dropped connection: the command runs detached with a heartbeat watcher that re-attaches if the stream dies. The real exit code is preserved.
For the full flag table, the egress presets, the enforcement caveats, fanout, and the OOM/disk/bandwidth traps on heavy builds → references/offload-and-egress.md.
Code you would rather not run on the user's machine — untrusted, generated, or just not yours to run locally — goes to exec: it writes the file into a fresh box, runs it with the right toolchain, and destroys the box.
cos exec -i input.txt solution.py arg1 # stdin from a file, args after the file
cos exec -t 10 -N suspect.js # 10 s limit, no network at all
cos exec -l go - <<'GO'
package main
import "fmt"
func main() { fmt.Println("hi") }
GO
Languages: py js mjs cjs ts go sh rb c cpp rs (from the extension, or -l). Everything after <file> reaches the program unchanged. stdout/stderr pass through, the exit code is the program's, exit 124 means the -t limit (default 120 s) killed it, and cos: exit=N time=Ns goes to stderr. Egress is unrestricted by default like offload; -N denies all of it (enforced by an IP rule, so it applies immediately). More than one file, or dependencies to install → offload.
cos fanout -j 2 -p python-uv . 'pytest -q tests/unit' 'pytest -q tests/integration' 'ruff check'
Each job gets its own box with no shared network — that is what distinguishes it from cluster. -j defaults to 2 to match the concurrency external keys have been observed to allow; going higher just queues the extra jobs rather than failing.
For repeated runs against a warm box, or a dev server you edit against. One box per git root, tracked in a statefile.
cos up -s s-2vcpu-2gb # create/reuse this project's box
cos up -P 22h -d 40960 # longer idle auto-pause, 40 GiB disk (Docker-heavy apps)
cos run 'npm ci' # warm it — deps persist across runs
cos sync ~/app /work # one-way by default (laptop → box), background
cos run 'npm run dev &' # start a watcher; it sees synced edits
cos status # box + sync + tunnels + forks
cos pause # park it at zero compute cost
cos resume # bring it back exactly as it was
cos down # stop sync + destroy the box
up is for a box you intend to reuse and then tear down. A bare "run this in a sandbox" is not Pattern B — use cos offload (one-shot, auto-destroys) or cos shell. Reaching for up to satisfy "create a sandbox" makes the box outlive the task, and a later cos down destroys it along with anything else sharing that statefile.
Ending a session: prefer pause over down when the box has a warm toolchain the user will want again. down destroys and the next session reinstalls everything; pause snapshots disk and memory, stops compute billing, and brings everything back on resume — measured end-to-end at around 6–8 s each way through the CLI. Use down when the work is genuinely finished.
If a box under this project's name is running but the statefile is gone (another checkout, another agent, created by hand), up refuses rather than adopting it — adopting silently would let a later cos down destroy a box this project never created. cos up -a adopts explicitly, and an adopted box is never destroyed by cos down.
cos sync defaults to one-way (laptop → box) — the safe direction for a dev loop.
| Flag | Mode | Behavior |
|---|---|---|
| (default) | one-way | laptop wins; box changes NOT pulled back. No bleed-back. |
-2 | two-way | bidirectional; box-side writes (build output, deps) flow back to the local dir |
-M | mirror | one-way and deletes box-side files absent locally |
-x <glob> | — | exclude paths (repeatable) |
.git and the big regenerable dirs are excluded by default — build deps inside the box with cos run 'npm ci' rather than syncing them up. Only reach for -2 when a box-side process genuinely produces files you need back locally, and never on the user's repo root without saying so first; prefer offload -o for pulling artifacts. The local dir must resolve under $HOME or /tmp. The first sync downloads its sync engine, so allow a minute before edits propagate.
cos run 'npm run dev &' && cos tunnel 3000 # private → http://127.0.0.1:3000
cos expose 8080 # public HTTPS URL to share
cos unexpose # revoke
cos cluster up 3 # 3 boxes on one private net, name-addressable
cos cluster run -a 'uname -a' # fan a command across every member
cos vpn register my-laptop && cos vpn up # WireGuard L3 into the private network
tunnel is private, expose is public. Prefer tunnel for dev loops. Use expose to share a preview with the team or to give a webhook a target.0.0.0.0:<port>, not loopback — ingress arrives on the box's interface. A loopback-bound server passes every in-box check and still returns nothing through the URL.cos unexpose when the demo is done.cos vpn up and cos shell block and need a real terminal — hand them to the user (!cos vpn up) rather than launching them as agent commands.For the DNS names cluster members resolve each other by, and the rest of the expose/tunnel/VPN detail → references/networking.md.
Some work needs a screen: a real (not headless) browser, a GUI app, or an install flow that only exists as a wizard. cos desktop puts the project box on the desktop:1 rootfs — XFCE, Google Chrome, xdotool/wmctrl/scrot/xclip — and hands back a live noVNC URL.
cos desktop # desktop:1 box + ingress + noVNC URL (waits for the desktop to boot)
cos computer screenshot # PNG → prints a path; open it with the Read tool
cos computer screen # {"width":1280,"height":800} — the coordinate space
cos computer open https://example.com
cos computer click 640 400
cos computer type 'hello'
cos computer key ctrl l # a chord
cos computer help # every op, plus `raw` for the rest of the API
The two halves are independent and useful together: the URL lets the user watch and take over in a browser, while cos computer lets you act. desktop:1 ships the same five agent CLIs devbox:1 does, so "run an agent on a box and let the user watch the screen" needs no extra setup — see Pattern E and references/coding-agents.md for pointing them at a provider.
Things that will bite you if you skip them:
cos computer screen rather than assuming 1280x800.running. cos desktop polls for readiness; a bare cos up -r desktop:1 does not, and every computer call will fail until the stack is up.409 is ambiguous by design. fc returns desktop_unavailable both while the desktop is still coming up and when an action fails on a perfectly healthy desktop, so never read it as "the box is broken".cos calls the CreateOS REST API directly, because the createos CLI has no computer or desktop command yet. Everything else still goes through the CLI.devbox:1 ships five agent CLIs — claude, codex, opencode, pi, cursor-agent — so "have a different agent do this in a box" needs no install. Each can be pointed at OpenRouter, an OpenAI-compatible provider, or an Anthropic-compatible one (with real exceptions, below), so this does not require the user to hold an Anthropic subscription.
export OPENROUTER_API_KEY=sk-or-... # in the user's own shell
cos agent -m openai/gpt-5.6-luna -o . claude . 'fix the failing tests'
cos agent -P anthropic -m claude-sonnet-4-5 -o . pi . 'add type hints'
cos agent -P https://gw.example.com/v1 -k MY_KEY -o . codex . 'port this to v2'
cos agent <agent> <dir> <prompt> stages the directory, wires the agent to the provider, runs it headless with its permission gate off (the microVM is the isolation), and destroys the box. Flags: -P provider (default openrouter), -m model, -k the env var holding the key, plus every offload flag.
What to get right:
-o . or the work is lost. Without it the box is destroyed with the agent's edits inside and you keep only the transcript. Run it on a clean tree so git diff shows exactly what changed.-v/-k, never from the conversation. Same rule as the CreateOS key — asking them to paste a provider key writes it to the transcript.cursor-agent runs only on Cursor's own service — no third-party provider path exists. codex speaks only the OpenAI Responses wire, so a plain Chat-Completions gateway is rejected at config load. opencode and pi will talk to anything.-p openrouter (or -p openai / -p anthropic) is worth reaching for, composed with whatever registries the task itself needs: -p openrouter -p npm.The per-agent env blocks, the wire-protocol matrix, and the traps (claude needs IS_SANDBOX=1 as root; openrouter.ai/api vs /api/v1) → references/coding-agents.md.
cos shell # instant clean Linux, destroyed on exit — HAND THIS TO THE USER
cos disk create data --bucket my-bucket --endpoint https://s3.amazonaws.com \
--access-key … --secret-key … [--region us-east-1] [--path-style]
cos disk attach data /mnt/data # needs the project box; the bucket stays in the user's account
cos disk detach data /mnt/data # unmount; bucket untouched
Disk data lives in the user's own S3 account and region. --path-style is needed for MinIO and R2. Prefer scoped, least-privilege keys, and prefer the CLI's interactive prompts over passing secrets as arguments — command lines are visible to other local users and land in shell history. Detaching only unmounts; it never deletes bucket data. Note that a fork does not carry disk mounts — re-attach on the clone.
cos up -P 22h (max 24h), or on a live box with createos sandbox edit <id> --auto-pause 4h, when a box is serving an exposed URL people will hit intermittently — otherwise the demo will look dead between visitors.KEY=VALUE pairs so you can find it again: createos sandbox create --label k=v, createos sandbox edit <id> --label k=v (merges), createos sandbox list --label k=v (must match every pair). cos does not set them. Details in references/lifecycle-and-images.md.cos pause (keeping the warm state) or cos down (done for good). Don't leave a running box behind either way.cluster and fanout against it and expect excess jobs to queue rather than fail.createos sandbox shapes.cos only ever destroys boxes it created itself; a box adopted with cos up -a survives cos down.createos sandbox shapes, or the Limits page.Load these when the task actually needs the depth — the summaries above are enough for most work.
| File | Read it for |
|---|---|
references/offload-and-egress.md | offload flag table, egress presets and how enforcement really behaves, fanout, upload excludes, heavy-build OOM/disk/bandwidth traps |
references/networking.md | choosing between tunnel/expose/cluster/vpn, cluster DNS names, expose gotchas, WireGuard setup |
references/coding-agents.md | the five agent CLIs in devbox:1, per-agent provider wiring (OpenRouter / OpenAI-compatible / Anthropic-compatible), which agents can't be repointed, egress around an agent box |
references/lifecycle-and-images.md | pause/resume, auto-pause tuning, labels, fork caveats, built-in rootfs vs custom templates, env vars, remote editor, self-terminating jobs, single-file transfer, measured timings |
references/docs.md | every page of the live CreateOS Sandbox docs as a fetchable .md URL — REST API, SDKs, CLI reference, limits, concepts, integrations. Fetch only the page you need |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
createos, sandbox, remote-execution, ephemeral-environments, cos-cli
Other plugins' skills for the same job
/createos-sandbox-codex:using-createos-sandboxfrom createos-sandbox-codex
npx claudepluginhub nodeops-app/createos-plugins --plugin createos-sandbox-codex2 plugins in one repository ship this exact skill · first indexed Nov 1, 2026