All resources
Guide/8 min read

Running Claude Code and Codex in the cloud, off your laptop: 6 setups, 3 tested

Published · Updated

Summary

We timed one bug fix to a PR on Remote Control, a cloud VM with tmux, and Replicas. Plus what Claude Code and Codex need to run in the cloud.

Claude Code and Codex stop when your laptop sleeps, because they run on your laptop. There are six common ways to keep them going while the lid is shut, or to start and check work from your phone. Two are Anthropic's and OpenAI's own clouds, one keeps the agent on your computer and lets you drive it from your phone, and the other three move the agent somewhere else: a server you rent, GitHub's runners, or Replicas.

We gave the same small bug fix to each one we could run and timed it to an open pull request. Three of the six ran end to end. The other three needed a login or permission our test setup didn't have, so they're described from the vendors' docs, with what happened when we tried.

How we tested

An agent working in a Replicas workspace ran every test on October 26 and 27, 2026. It had Anthropic and OpenAI API keys, a Claude Max login on October 26 only, a GitHub login for one of our private repositories, and an account for renting cloud VMs. It had no ChatGPT login, no phone, and no permission to add GitHub Actions secrets. Prices and plan details were checked against the linked vendor pages on October 27, 2026.

The task was a real bug in a small basketball league simulator of ours: playoff games were being added to the regular-season standings. The fix is one line. Every setup got this prompt:

Every run that finished made the same fix and opened a PR.

The six setups

"Our run" is the time from sending the prompt to the PR appearing on GitHub. Results for the setups we ran come from those runs, and every other cell links to its source.

SetupWhere the agent runsWhat you needOur runCostPull request
Claude Code on the web (claude --cloud, Claude app)Anthropic's VM, about 4 vCPU and 16 GBA Claude Pro, Max, Team or eligible Enterprise seat and a GitHub repoNot run: our API-key login was refused, and our Max token got a 403Included in the plan, from $20/moPushes a branch; you create the PR
Remote Control (claude --remote-control)Your own computer, which has to stay onA claude.ai plan; API keys aren't supported2m 43s (Oct 26, Max plan)Plan usage, from $20/moThe agent opens it
Codex cloud (chatgpt.com/codex, ChatGPT app)OpenAI's VM: 2 vCPU and 8 GiB on Plus, 4 vCPU and 16 GiB on Pro and BusinessA ChatGPT Plus, Pro, Business or Enterprise plan and a GitHub repo; API keys don't workNot run: needs a ChatGPT sign-inIncluded in the plan, from $20/moYou open it from the task
Rented VM with tmuxA Linux server you rentSSH, the CLIs, an API key or plan login, and a GitHub login on the server27–31s (Oct 27, Claude Code and Codex)$0.08–0.12 of tokens per run, plus the server: $24/mo for 2 vCPU and 4 GBThe agent opens it
GitHub Actions (claude-code-action, codex-action)GitHub's runnerRepo admin, plus an ANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN or OPENAI_API_KEY secretNot run: we couldn't add repository secretsTokens, plus runner time at $0.006/min after the free minutesClaude pushes a branch with a PR link; the Codex action doesn't make one
ReplicasA cloud VM per taskA Replicas account, plus a Claude or ChatGPT plan or API keys1m 18s–2m 03s (Oct 26–27, Codex and Claude Code)VM time at $0.008/min for the default size, plans from $50/mo, plus model usageThe agent opens it

If you use one agent and your code is on GitHub, Anthropic's and OpenAI's own clouds are the easiest place to start. There's nothing to install, and they come with plans you may already pay for. The other four make sense when you need something those don't do: your own machine's files, API-key billing, another git host, or more than one agent.

How long each run took

Same issue · same prompt · one run per bar

Time from sending the task to an open PR

October 26–27, 2026

Setup · agent · date

seconds

Rented VM + tmux

Claude Code, interactive · Oct 27

27s

Rented VM + tmux

Codex · Oct 27

29s

Rented VM + tmux

Claude Code, headless · Oct 27

31s

Replicas

Codex · Oct 27

78s

Replicas

Codex · Oct 26

98s

Replicas

Claude Code · Oct 26

123s

Remote Control

Claude Code · Oct 26

163s

Fixed, type-checked, opened the PRAlso wrote a script to reproduce the bug first

The VM runs were fastest because they did the least. The Remote Control and Replicas runs happened inside our workspaces, which load our team's saved instructions, and one of those tells agents to reproduce a bug before fixing it. So those agents wrote a small script that ran a playoff game against an in-memory database, watched the standings change, applied the fix, and ran the script again. We think that check, and reading the instructions, account for most of the extra minute or two. A workspace without those instructions would likely finish closer to the VM times.

A rented VM with tmux

This is the do-it-yourself version: rent a Linux server, install the agents, and run them inside tmux so they keep going after you disconnect. We rented a fresh Ubuntu 24.04 VM with 2 vCPUs and 4 GB of RAM by the second from E2B, and connected through E2B's terminal API instead of SSH. Everything after that works the same on any VPS.

A terminal connects to the VM, starts tmux, launches Claude Code with the issue 34 prompt, detaches, lists the tmux session and logs out. After reconnecting and reattaching, Claude Code reports it opened PR #44.

Start the agent in tmux, detach with Ctrl-b d, log out, then come back and reattach. Claude Code opened PR #44 27 seconds after the prompt was sent. The wait while logged out is shortened.

The setup on the fresh VM took 50 seconds: 19 for the apt packages, 16 for Node.js, 9 for the Claude Code installer and 5 for the Codex installer.

Both agents then fixed the bug and opened their PRs in about half a minute: Codex in 29 seconds and about $0.08 of tokens, Claude Code in 31 seconds and $0.12. Neither ran anything beyond the type check.

What tripped us up:

  • The first VM was too small. The default sandbox had 512 MB of RAM. Claude Code needs 4 GB or more, so we started again with a bigger one.
  • Claude Code asks five questions on its first interactive start: a color theme, whether to use the API key it found (the default answer is no), a security note, whether to trust the folder (the default is "No, exit"), and a warning about skipping permissions. Answer them once before you rely on it unattended.
  • No git identity means no commit. In a first run on a fresh Ubuntu container on October 26, both agents made the fix and then stopped, because git had no name or email set. Set those and log in to GitHub before you leave.
  • tmux showed underscores instead of symbols until we started it with tmux -u on a machine without a UTF-8 locale.

To reach the server from a phone you need an SSH app, such as Termius or Blink. We didn't test that. Remote Control's docs suggest running it inside tmux on a remote machine, which would let the Claude app reach the session without SSH, but it needs a claude.ai login on the server.

Our VM ran for 10 minutes and cost about $0.03 at E2B's per-second rates. Left on for a month, those rates come to about $119, so for a box that's always on, a monthly VPS is cheaper: $24 at DigitalOcean, or €5.99 for Hetzner's CX23, which was listed as unavailable when we checked.

Remote Control

Remote Control keeps your computer as the place the agent runs and lets you follow and steer the session from the Claude app or claude.ai/code. Your files and tools stay where they are. Anthropic's docs say the session reconnects after your machine sleeps or loses its network, but the computer and the claude process have to be running for any work to happen. The transcript is stored on Anthropic's servers while it's connected.

We started it with claude --remote-control in one of our workspaces, which stood in for the laptop, while signed in with a Claude Max plan. We had no phone, so we sent the prompt from a second terminal into the same session through Anthropic's relay, which is the session the Claude app would show. Claude Code labelled it as a message from "another Claude session" rather than from the user, then did the work and opened the PR 2 minutes 43 seconds later.

With an API key instead of a plan, it refuses to start:

Remote Control fits when the work needs your machine: local services, private network access, a big local checkout, or tools you don't want to set up anywhere else. It doesn't help if the laptop itself goes in a bag.

Replicas

Replicas starts a fresh cloud VM for each task, with your repository cloned and the agent you pick signed in. We made an environment for the test repository, which was ready 22 seconds later, then started one workspace per agent from the command line:

The agent's first output came about 5 seconds after each request. Codex opened its PR in 1 minute 38 seconds on October 26 and 1 minute 18 seconds on October 27. Claude Code on Opus 5.5 took 2 minutes 3 seconds, and by its own count used $0.48 of tokens at API prices. It ran on a Claude plan, so there was no API bill. All three wrote the reproduction script described above before fixing anything.

VM time is billed by the minute while a workspace is awake, at $0.008 a minute for the default large size, or $0.004 for small, and a workspace sleeps after 30 idle minutes. So the compute for a task like this on the default size is somewhere between 2 and about 26 cents, depending on how long you leave it open. The model usage goes to your own Claude or ChatGPT plan, or your API key.

It fits when you want the laptop out of the loop and need Claude Code, Codex and other agents in one place, GitLab as well as GitHub, or tasks started from Slack, Linear, a GitHub comment or the iOS app. You can try it with $100 of free usage, no card needed.

Anthropic's and OpenAI's own clouds

Claude Code on the web

This is Anthropic's hosted version. Start a session at claude.ai/code, from the Code tab in the Claude app, or with claude --cloud "your task" in a terminal. Each session gets an Ubuntu 24.04 VM, and claude --teleport pulls a finished session back into your terminal. According to Anthropic's docs:

  • It's on Pro, Max and Team plans, and on Enterprise for premium or Chat + Claude Code seats. Usage counts toward your plan's limits, with no separate charge for the VM.
  • It works with GitHub. GitLab and Bitbucket repos can be sent as a bundle, but the session can't push back to them.
  • Network access defaults to an allowlist of package registries, GitHub and cloud SDKs. You can switch it to none, full or your own list.
  • When it's done, Claude pushes a branch, and you create the PR from the session.

It doesn't work with API keys or Bedrock. With our API key, claude --cloud stopped with "Cloud sessions are disabled by your organization's policy." With a Max login made by claude setup-token, which only carries inference permissions, it got a 403. Sign in with your Claude account instead.

Codex cloud

OpenAI's version runs at chatgpt.com/codex, in the Codex section of the ChatGPT mobile app, and through codex cloud in the CLI. From OpenAI's docs:

  • It's on Plus, Pro, Business, and Enterprise or Edu. It requires a ChatGPT sign-in, so an API key won't work. Even after we logged the CLI in with an API key, codex cloud replied "Not signed in. Please run 'codex login' to sign in with ChatGPT."
  • It's GitHub only for now. GitLab and self-hosted GitHub Enterprise Server are on the roadmap.
  • Internet access for the agent is a setting you turn on per environment.
  • Tasks keep running while your computer sleeps, and you open a PR from the result.
  • From your phone you can start tasks in an existing environment. New environments have to be made on the web or in the desktop app.

To control your own computer from the ChatGPT app instead, OpenAI's remote connections need the ChatGPT desktop app on a Mac or Windows PC, and can't be set up from the Codex CLI. The CLI's experimental codex remote-control pair told us pairing was "unavailable until enrollment completes" when signed in with an API key.

GitHub Actions

Both vendors publish an action that runs the agent on GitHub's runners. We couldn't test them because our GitHub account couldn't add repository secrets, so this section is from the docs.

  • claude-code-action: running /install-github-app in Claude Code sets it up. Mention @claude in an issue or PR comment and it works on a branch, then posts a link to a pre-filled PR. It takes an API key, or a CLAUDE_CODE_OAUTH_TOKEN that bills your Claude plan.
  • codex-action: runs codex exec in a workflow with an OpenAI API key and returns Codex's final message. Turning that into a PR or a comment is up to the rest of your workflow.

Private repos get 2,000 free runner minutes a month on GitHub Free and 3,000 on Pro and Team, then $0.006 a minute on Linux, and a job can run for up to 6 hours. This is the setup to use when the trigger is an issue or a PR, and you can start it from your phone by commenting in the GitHub app. For work on a timer, see scheduled Claude Code tasks.

Which one fits

If youStart with
Use Claude Code only, on GitHubClaude Code on the web
Use Codex only, on GitHubCodex cloud
Need your own machine's files, services or network, and can leave it onRemote Control
Want API-key billing, any git host and full control, and don't mind looking after a serverA VPS with tmux
Want issues and PRs to start the workGitHub Actions
Use more than one agent or GitLab, or start work from Slack and LinearReplicas

For plan limits and model prices, see Codex vs Claude Code. For how the two terminal agents differ, see OpenCode vs Claude Code. To run them with permission prompts off, see how to run Claude Code in a sandbox.