How to let Claude Code use awx from your terminal
Claude Code works in your terminal. Give it a short prompt and an API key, and it can make an awx computer, build something in it, share a link and clean up after itself.
Our Knowledgebase has a prompt for LLM agents: a page of instructions an agent reads before it starts. We wanted to see how far an agent gets with that page and nothing else, so we gave Claude Code one job and watched what it did. This post is that run, step by step.
What you need
- An approved
awxaccount. - An API key: open Account, then API keys, and press Create key. It is shown once.
- Claude Code (or another agent that can run commands in a terminal).
You do not need to install the awx command first. The prompt tells the agent how, and it did that on its own.
Set up a folder
Make an empty folder and save the prompt in it as CLAUDE.md. Claude Code reads that file when it starts in the folder. Then put your key in the terminal, not in the chat:
mkdir awx-job && cd awx-job
curl -o CLAUDE.md https://awanbox.com/knowledgebase/for-llm-agents/awx-agent-prompt.md
export AWX_API_KEY=bx_...
Other agents read AGENTS.md instead; save the same file under that name.
Ask for the job
Start claude in the folder and say what you want. This is the exact request from our run:
Using awx, make a Small computer named llm-agent-test2. Inside it, make a web page that says 'Hello from an LLM agent' and serve it on port 8000. Give me a public preview link to it, and check with curl from here that the page loads through that link. Then save a screenshot of the computer's desktop showing that page in a browser, in this folder as desktop.png. When that is done, delete the computer llm-agent-test2: I give you permission to delete that one computer, and nothing else. Finally, tell me what you did, the preview link, and anything in your awx instructions (CLAUDE.md) that was unclear, wrong or missing.
The last sentence is worth keeping. Asking the agent what was unclear in its instructions is how we improved the prompt.
What the agent did
It took 12 steps and about 50 seconds. In order:
- Checked for the command.
awxwas not installed and neither waspipx, so it installedawx0.3.0 withpipinto the virtual environment it was running in, as the prompt says. - Checked the account with
awx whoamiand looked at the list of computers before making a new one. - Made the computer:
$ awx sandbox create --name llm-agent-test2 --size small ID NAME STATE SIZE RUNTIME IDLE_S 600c6b6e llm-agent-test2 running small container 0 - Wrote the page and started a server inside it, listening on
0.0.0.0and running in the background with its output sent to a file, checked the page from inside the computer, then asked for a link:$ awx sandbox exec llm-agent-test2 -- bash -c 'mkdir -p /home/agent/site && echo "<h1>Hello from an LLM agent</h1>" > /home/agent/site/index.html && cd /home/agent/site && nohup python3 -m http.server 8000 --bind 0.0.0.0 > /tmp/http.log 2>&1 &' $ sleep 2; awx sandbox exec llm-agent-test2 -- curl -s localhost:8000 <h1>Hello from an LLM agent</h1> $ awx sandbox preview llm-agent-test2 --port 8000 https://qynfcaq5e46zz5ijheukl6bb.awanbox.com/ - Checked the link from outside before handing it over:
$ curl -s -w '\nHTTP %{http_code}\n' https://qynfcaq5e46zz5ijheukl6bb.awanbox.com/ <h1>Hello from an LLM agent</h1> HTTP 200 - Opened the page in Chrome inside the computer, waited a few seconds, and took a screenshot of its desktop. (The prompt now suggests the shorter
chromecommand, which adds those options for you.)$ awx sandbox exec llm-agent-test2 -- bash -c 'DISPLAY=:0 nohup google-chrome --no-first-run --no-sandbox http://localhost:8000 >/dev/null 2>&1 &' $ sleep 8; awx sandbox shot llm-agent-test2 desktop.png saved desktop.png - Deleted the computer, the only one it had permission to delete, and checked it was gone. The link stopped working with it.
Along the way it did not print the key, did not touch the other computers on the account, and told us at the end what it had done and what it would change in its instructions.
The first try missed one thing
This was our second run. In the first one the agent did everything right except the screenshot: it saved a picture of an empty desktop, because nothing had told it to open the page in a browser first. It said so itself in its notes.
We added that step to the prompt, along with the rest of its notes: what to do when pip refuses to install, what a new computer costs, how preview addresses look, and that delete does not ask for confirmation, which is why the agent has to ask you. The second run, above, used the updated prompt.
Keep it on a short leash
In an interactive session Claude Code asks before it runs each new kind of command, so you see everything it does. To run a job without watching, list the only commands it may use. This is how we ran ours:
claude -p "<your request>" \
--allowedTools "Bash(awx:*)" "Bash(pip:*)" "Bash(pipx:*)" "Bash(curl:*)" "Bash(ls:*)" "Bash(cat:*)" "Read"
With that list the agent can use awx and install it, but cannot run anything else on your own computer.
Common questions
Does Claude Code need anything installed to use awx?
Only the awx command, and the agent installs it itself if it is missing: with pipx, or with pip inside a virtual environment. It needs Python 3.10 or newer.
Does the agent see my API key?
It reads it from AWX_API_KEY in the terminal. The prompt tells it never to print the key or copy it anywhere, and in our runs it never appeared in the agent's output.
Can the agent delete my other computers?
Not without asking you. The prompt tells it to ask before deleting anything. In this run it deleted only the computer we named, because the task gave it permission for that one.
How long did the run take?
About 50 seconds and 12 steps, from installing awx to deleting the computer.
Cautions
- Keep the key out of the chat. Set
AWX_API_KEYin the terminal, and give each agent or machine its own key so you can revoke one alone. - Running time uses credit on the Free plan, and each extra computer costs credit once. The prompt tells the agent to stop or reuse computers; check your Usage page now and then.
- Read what it built. The page here is one line; for anything larger, look at the files before you rely on them.
- Keep your own copy of anything that matters.
awxis in early alpha.
Keep reading
- For LLM agents: the prompt, and how to give it to your agent
- How to run awx computers from your terminal
- How to give the agent a job, then close your laptop
- How to test your website in a real browser with AwanBox
Getting started
Sign in with your Google account, make an API key on the Account page, save the prompt as CLAUDE.md, and ask Claude Code for a small job first.
Awi, signing off.