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.
1- key: claude-code2use: node3run: |4npm install -g @anthropic-ai/claude-code56mkdir -p ~/.claude7cat <<'EOF' > ~/.claude/settings.json8{9"permissions": {10"defaultMode": "bypassPermissions"11}12}13EOF1415cat <<'EOF' > ~/.claude.json16{17"bypassPermissionsModeAccepted": true,18"hasCompletedOnboarding": true19}20EOF2122claude config set -g autoUpdates false23claude config set -g preferredNotifChannel notifications_disabled24claude config set -g theme dark25claude 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
.
1- key: claude2use: [claude-code, tasks-needed-to-work-on-your-project]3cache: false4timeout: 30m5run: |6echo "Running Claude Code..."78prompt=$(cat $PROMPT_FILE)9echo "$prompt"1011echo "Executing prompt..."12claude --dangerously-skip-permissions \13--append-system-prompt "Provide final result output as a pull request description." \14-p "$prompt" | tee "$RWX_VALUES/claude-result"1516echo "Generating title..."17claude --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"2021echo -e "## Run\n" | tee -a "$RWX_VALUES/pr-description"22echo -e "$RWX_RUN_URL\n\n" | tee -a "$RWX_VALUES/pr-description"2324echo -e "## Prompt\n" | tee -a "$RWX_VALUES/pr-description"25echo "$prompt" | tee -a "$RWX_VALUES/pr-description"2627echo -e "\n## Result\n" | tee -a "$RWX_VALUES/pr-description"28cat "$RWX_VALUES/claude-result" | tee -a "$RWX_VALUES/pr-description"29env:30CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 131CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.claude-code-oauth-token }}32PROMPT_FILE: ${{ run.dir }}/prompt.md
Create a Pull Request
Finally, you can use the github/create-pull-request package to create a pull request.
1- key: create-pull-request2call: github/create-pull-request 1.0.13use: claude4with:5github-token: ${{ github-apps.rwx-cloud-bot.token }}6branch-prefix: claude${{ run.id }}7pull-request-title: ${{ tasks.claude.values.pr-title }}8pull-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.
Related posts
Read more on updates and advice from the RWX engineering team