# Use Cloudex from your coding agent

> Let Claude Code, Codex or another coding agent on your computer create and drive Cloudex sandboxes, with a skill, an AGENTS.md snippet and the docs as plain text.

A coding agent on your computer can use the `cloudex` CLI the way you do: start a sandbox for a risky or long job, run commands and servers there, and give you a link to what it built. Every command prints JSON when its output isn't a terminal, so agents read it easily. Each of these tells an agent how.

## The Claude Code skill

```sh
mkdir -p ~/.claude/skills/cloudex
curl -fsSL https://raw.githubusercontent.com/lucataco/cloudex/main/skills/cloudex/SKILL.md \
  -o ~/.claude/skills/cloudex/SKILL.md
```

Claude Code loads it when a task calls for a clean Linux machine, a job away from your computer, a link to a running app, or copies of one environment working in parallel. It covers creating, stopping and forking sandboxes, `exec`, preview links, agents in a sandbox, and the costs to keep in mind. Other agents that read `SKILL.md` files can use the same file.

## An AGENTS.md snippet

For Codex, Cursor and other agents that read `AGENTS.md` or a similar file, add:

```md
## Cloudex sandboxes

`cloudex` runs Linux sandboxes (Ubuntu with sudo, Docker, Node, Python) in my Cloudflare account. Use one for long or risky jobs and for anything I should see running. Commands print JSON when piped; `cloudex <command> --help` lists the flags.

- `cloudex new --name <name>` creates one and makes it current; `--repo <https url>` clones a repo.
- `cloudex exec <name> -- '<shell command>'` runs a command (up to 1 hour with `--timeout 1h`). Start servers in the background (`nohup ... &`), then `cloudex host <name> <port>` gives me an HTTPS link.
- `cloudex stop <name>` saves the disk and stops; `cloudex resume <name>` starts it again. Stop sandboxes you no longer need; ask before `cloudex delete`.
```

## Reporting problems

When `cloudex` fails in a way that looks like a bug in Cloudex, the skill tells your agent to say so, and with your OK, to report it with [`cloudex feedback`](https://cloudex.build/docs/feedback.md): the agent shows you the report first, and sends it only once you agree. For other agents, add to the snippet above:

```md
- If `cloudex` fails in a way that looks like a bug in Cloudex, tell me. With my OK, run `cloudex feedback --last-error "what you were doing"`: it sends nothing, and prints a report and a `cloudex feedback --send <id>` command. Show me the report, and run that command only if I agree.
```

## The docs as text

[cloudex.build/llms.txt](https://cloudex.build/llms.txt) lists every docs page, and [llms-full.txt](https://cloudex.build/llms-full.txt) holds them all in one file. Each page is also Markdown at its URL plus `.md`.

## Agents inside a sandbox

Claude Code, Codex and OpenCode running in a sandbox already know how to manage it from inside, with the sandbox's own `cloudex` command; see [Inside the sandbox](https://cloudex.build/docs/sandboxes.md#inside-the-sandbox).
