Running Claude Code Agents in the Cloud on RWX

Agents
Aug 13, 2025
Dan Manges
Running Claude Code Agents in the Cloud on RWX

AI is changing the way that software is built. Agents can be used in a wide variety of ways, and when writing code, they can either be used synchronously or asynchronously.

Synchronously, an engineer starts a session with AI, providing an initial prompt. Engineers are largely using this workflow on their own machines. However, this approach creates some risk with giving AI the reigns and letting it run any command that it wants. It also creates an interactive scenario, where engineers are watching it, or context switching, and then guiding it as it works.

Engineers should also be running autonomous coding agents in the cloud. Give the agent its own resources, and let it crank away for a long period of time without a human having to review or intervene. RWX is a great platform for running agents like this.

Building Agentic Workflows on RWX

We're working on some first class features to support agentic workflows, but RWX is a generic cloud computing platform. You can easily use it to run any combination of tools to automate agents, pull requests, or any coding process that you want to facilitate. Here's an example of building your own Claude-powered workflows on RWX.

Project Dependencies

If you're already using RWX for running CI/CD, you already have a workflow that will install and configure everything that an agent needs to work on your project. If you're new to RWX, getting started is easy. You don't need to use RWX for CI/CD to run your agentic workloads on RWX. Our engineering team is happy to help you get started — get in touch.

Install and Configure Claude Code to run in the Cloud

This RWX task installs Claude Code, and configures it to run bypassing permissions. It assumes a node task has been defined that uses the nodejs/install package to install Node.

.rwx/claude.yml
1
- key: claude-code
2
use: node
3
run: |
4
npm install -g @anthropic-ai/claude-code
5
6
mkdir -p ~/.claude
7
cat <<'EOF' > ~/.claude/settings.json
8
{
9
"permissions": {
10
"defaultMode": "bypassPermissions"
11
}
12
}
13
EOF
14
15
cat <<'EOF' > ~/.claude.json
16
{
17
"bypassPermissionsModeAccepted": true,
18
"hasCompletedOnboarding": true
19
}
20
EOF
21
22
claude config set -g autoUpdates false
23
claude config set -g preferredNotifChannel notifications_disabled
24
claude config set -g theme dark
25
claude config set -g verbose true

Run Claude Code in the Cloud

To actually run Claude Code, you'll need to generate an oauth token locally with claude setup-token and store it as a secret in an RWX vault.

For now, we'll plan to kick off this workflow using the RWX CLI.

Because the RWX CLI will sync the entire .rwx directory, we'll put the prompt in .rwx/prompt.md.

.rwx/claude.yml
1
- key: claude
2
use: [claude-code, tasks-needed-to-work-on-your-project]
3
cache: false
4
timeout: 30m
5
run: |
6
echo "Running Claude Code..."
7
8
prompt=$(cat $PROMPT_FILE)
9
echo "$prompt"
10
11
echo "Executing prompt..."
12
claude --dangerously-skip-permissions \
13
--append-system-prompt "Provide final result output as a pull request description." \
14
-p "$prompt" | tee "$RWX_VALUES/claude-result"
15
16
echo "Generating title..."
17
claude --continue --dangerously-skip-permissions \
18
-p "Generate a single line summary of the changes that you just made suitable for a pull request title" \
19
| tee "$RWX_VALUES/pr-title"
20
21
echo -e "## Run\n" | tee -a "$RWX_VALUES/pr-description"
22
echo -e "$RWX_RUN_URL\n\n" | tee -a "$RWX_VALUES/pr-description"
23
24
echo -e "## Prompt\n" | tee -a "$RWX_VALUES/pr-description"
25
echo "$prompt" | tee -a "$RWX_VALUES/pr-description"
26
27
echo -e "\n## Result\n" | tee -a "$RWX_VALUES/pr-description"
28
cat "$RWX_VALUES/claude-result" | tee -a "$RWX_VALUES/pr-description"
29
env:
30
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1
31
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.claude-code-oauth-token }}
32
PROMPT_FILE: ${{ run.dir }}/prompt.md

Create a Pull Request

Finally, you can use the github/create-pull-request package to create a pull request.

.rwx/claude.yml
1
- key: create-pull-request
2
call: github/create-pull-request 1.0.1
3
use: claude
4
with:
5
github-token: ${{ github-apps.rwx-cloud-bot.token }}
6
branch-prefix: claude${{ run.id }}
7
pull-request-title: ${{ tasks.claude.values.pr-title }}
8
pull-request-body: ${{ tasks.claude.values.pr-description }}

Full Implementation and Demo

Here's the full implementation:

https://github.com/rwx-cloud/calculator-demo/blob/main/.rwx/claude.yml

And here is a pull request opened by Claude Code. The PR description contains the prompt that was used.

https://github.com/rwx-cloud/calculator-demo/pull/7

Never miss an update

Get the latest releases and news about RWX and our ecosystem with our newsletter.

Share this post

Enjoyed this post? Pleas share it on your favorite social network!

Related posts

Read more on updates and advice from the RWX engineering team

See all posts