Guides

How to run Claude Code in the cloud

Compare the common ways to keep Claude Code working off your laptop: what the agent can reach, what happens when it's idle, and what each one costs.

The short answer

There are four common ways to run Claude Code in the cloud. Anthropic's cloud sessions come with paid Claude plans and run each task in a fresh VM with your GitHub repository. They suit tasks that need only the code. A VM you manage, with Claude Code in tmux over SSH, can be a cheap solution for people who want full control and are ok maintaining a server. Managed platforms run Claude Code and other agents on machines built from setup scripts. Boxes.dev runs Claude Code and Codex on full copies of a cloud machine where your app already runs, so the agent can start your app and test its changes.

Why move Claude Code off your laptop

Claude Code runs as a process on the computer where you start it. If that's your laptop, the session stops working when the laptop sleeps or you close the terminal. Running it on a cloud machine helps in three ways:

  • Work continues while you're away. A long task can run through a meeting or overnight, and you can check on it from your phone.
  • Tasks don't compete for one machine. Sessions on one laptop share its ports, databases, and memory, and they need separate worktrees to avoid editing the same files.
  • The agent stays away from your personal files and credentials. You can give it broader permissions on a machine that holds only what the task needs.

The options below differ most in what the cloud machine starts with: a fresh copy of your repository, a server you set up by hand, or a copy of an environment where your app already runs. The starting point determines whether the agent can run your app and test its changes the way you would.

The options at a glance

As of September 2026. Managed platforms differ too much from each other to fit in one column, so they're described in their own section.

Anthropic's cloud sessionsA VM you manageBoxes.dev
Where Claude Code runsA fresh Anthropic-managed VM for each sessionA server you rent, such as a DigitalOcean Droplet or an EC2 instanceA devbox for each task: a full, isolated copy of a cloud machine where your app already runs
What the machine starts withYour GitHub repository on Ubuntu with common languages, Docker, PostgreSQL, and Redis, plus files your setup script installedWhatever you install and configureA copy of a machine set up with your app's tools, databases, services, and data
When it's idleThe VM is reclaimed; reopening the session starts a fresh VM with the conversationIt keeps running, billed by the hour or monthIt sleeps after about five minutes, keeping files and memory, and resumes where it left off
Working on the machineClaude runs every command, and you review its diffs and messagesA full shell over SSHTerminal tabs, a file editor, Git review, a browser you share with the agent, and SSH
From your phoneThe Code tab in the Claude appAn SSH app, or Remote Control through the Claude appThe Boxes.dev iOS and Android apps, which include a terminal
AgentsClaude CodeAny agent you installClaude Code and Codex
CostIncluded in Claude Pro ($20 a month), Max, Team, and Enterprise plans; sessions count toward the plan's usage limitsThe server, for example $48 a month for 4 vCPUs and 8 GB on DigitalOcean or about $130 on AWS EC2, plus your Claude planStarter $19 or Pro $99 per user each month, with 40 or 250 box-hours included, plus your Claude plan

Anthropic's cloud sessions

Anthropic runs Claude Code for you in cloud sessions, also called Claude Code on the web. They come with Claude Pro, Max, and Team plans, and with Enterprise seats that include Claude Code. You can start a session at claude.ai/code, in the Code tab of the Claude app, or by choosing Cloud in the Claude desktop app. From your terminal, pass the task to claude --cloud:

claude --cloud "Fix the flaky test in auth.spec.ts"

Each session gets a fresh Ubuntu 24.04 VM with your GitHub repository cloned at your current branch, so push local commits first. The VM includes common language toolchains, Docker, PostgreSQL 16, and Redis 7; the databases aren't running until Claude starts them. Anthropic lists approximate limits of 4 vCPUs, 16 GB of memory, and 30 GB of disk. A cloud environment adds environment variables, a network access level, and a setup script. When the script finishes within about five minutes, Anthropic caches the files it installed for about seven days, so later sessions start with your dependencies in place. The cache keeps files only, so Claude has to start databases and docker compose services again in each session.

You can't open a shell in the VM. Claude runs every command, and you review its work in a diff view where you can comment on lines. Configuration that lives only on your computer, such as user-level skills, MCP servers, and settings, doesn't carry over, so commit what the agent needs to the repository's .claude/ directory and .mcp.json. When a session sits idle, Anthropic reclaims the VM. Reopening the session starts a fresh VM with your conversation, but work that was still running, such as subagents and shell commands, isn't restored. To continue a session on your computer, run claude --teleport, which checks out the session's branch and loads the conversation.

Cloud sessions share rate limits with the rest of your Claude usage, so parallel sessions reach those limits sooner. There's no separate charge for the VM. Team and Enterprise organizations can also run sessions on their own infrastructure with self-hosted environments, which are in public beta.

Anthropic also publishes the Claude Code GitHub Action, which runs Claude Code on GitHub's runners when someone mentions @claude in an issue or pull request, or on a schedule. Each run uses GitHub Actions minutes and either API usage or your Claude subscription.

Cloud sessions suit tasks that need only your repository and the preinstalled tools, especially if you'd rather not run any infrastructure.

A VM you manage

You can install Claude Code on any Linux server and run it inside tmux, so it keeps working after you disconnect. Claude Code needs at least 4 GB of memory, and builds and test suites usually need more. To set one up:

  1. Create an Ubuntu server with your cloud provider, add your SSH key, and allow only SSH through its firewall.

  2. Connect over SSH and install Claude Code:

    curl -fsSL https://claude.ai/install.sh | bash
    
  3. Clone your repository, then install your app's dependencies, databases, and services.

  4. Start a tmux session and run Claude Code in it:

    tmux new -s claude
    claude
    

    The first time it runs, Claude Code will show a sign-in link. Open it in your laptop's browser, sign in, and paste the code the browser shows into the terminal.

  5. Detach with Ctrl+B and then D. To return later, connect over SSH and run tmux attach -t claude.

To reply from your phone, run claude remote-control inside tmux instead of claude. Remote Control is available on Pro, Max, Team, and Enterprise plans and connects the session to claude.ai/code and the Claude app. You can also use any SSH app on your phone. Apps such as T3 Code, Orca, and Superset can connect to a server like this and show its agents in a desktop or phone app.

Running one server can be inexpensive. As of September 2026, a DigitalOcean Basic Droplet with 4 vCPUs and 8 GB of memory costs $48 a month. On AWS, an EC2 c7i.xlarge instance of the same size costs about $130 a month on demand in US East, before storage. Either one costs the same whether or not an agent is working. Claude's usage counts toward your Claude plan.

A VM gives you a Claude Code session that keeps working after you close your laptop and that you can reach from your phone. The server is yours to maintain, including operating system updates, SSH access, backups, and the credentials you put on it. Agents on one server share its files, credentials, CPU, memory, ports, and databases. Each task needs its own worktree and ports, and one agent's build can slow down the others. A VM fits if you want a server that stays up at the lowest cost, if your agents can share one machine, or if you like running your own server, for example for a personal project.

Managed platforms

Several products run Claude Code on cloud machines they prepare for you, and most also run other agents, such as Codex, Cursor, and OpenCode. They differ in how they build each machine and how long it lasts. As of September 2026:

  • Replicas builds a VM for each task from hook scripts and keeps a pool of them ready. An idle VM sleeps after an hour and keeps its processes. Full seats start at $50 a month, and Flex seats are billed by the minute. See Boxes.dev vs Replicas.
  • Tembo gives each session a dedicated VM, prepared from a standard image and your project's setup, and destroys the VM when the session ends. Paid plans start with $60 in monthly usage allowance for up to five users. See Boxes.dev vs Tembo.
  • Niteshift prepares each task's environment from setup files it commits to your repository, and adds screenshots and videos from its browser testing to the pull request. Paid plans start with $50 in monthly credits, and active agent time costs $6 an hour. See Boxes.dev vs Niteshift.
  • Ellipsis runs Claude Code and Codex in sandboxes that last up to an hour, with agents and environments defined in YAML. It's free for individuals who connect a Claude or ChatGPT subscription. See Boxes.dev vs Ellipsis.

These platforms fit teams that want a wide choice of agents or want to start work from GitHub events and other outside tools.

Boxes.dev

Boxes.dev runs Claude Code and Codex on cloud machines that start as copies of your working development environment.

You'll start by setting up your app on a cloud machine called the Template box, with the tools, databases, services, and data it needs. A setup agent can copy the environment from your laptop, including the agent settings, skills, and MCP definitions you choose to bring, or build it from a GitHub repository. Boxes.dev saves the Template box as a snapshot. Each task then runs on its own devbox: a full, isolated copy of that machine.

You'd expect an engineer to run the app locally before shipping a change; a full dev environment lets agents do the same. On a devbox, Claude can start your app, test its changes in a browser, and reproduce bugs against your real services and data. It can also take screenshots and record video for you to review.

Boxes.dev runs the real Claude Code CLI with your Claude login or an API key, so your CLAUDE.md, skills, and hooks work the way they do on your laptop. You can talk to Claude in the desktop app's conversation view or in its own terminal interface. After you've set up a project, you can also start a task on a new devbox from your own terminal:

dvb claude

A devbox goes to sleep after about five minutes when no agent is working and nobody is using it. Sleep keeps its files and memory, so dev servers, databases, and terminal sessions pick up where they left off when it wakes. The devbox stays until you delete it. You'll get a notification when Claude replies or needs your input, and you can answer from the desktop app, the iOS and Android apps, or the dvb CLI. You can start work from Slack, Linear issues, or scheduled automations.

You can work on the devbox yourself, with terminal tabs, a file editor, diff review that sends your line comments to Claude, and a browser you share with the agent. The desktop app's Ports tool forwards the running app to the same port on your laptop. A public link shares the app with anyone. A Project URL gives your project one stable public address that OAuth callbacks and webhooks can use. You can also connect over SSH or open the devbox in VS Code or a JetBrains IDE.

Some things only need to be set up once for all your devboxes, including environment files, MCP servers, Claude plugins, and access to AWS and private services on your Tailscale network. With your permission, Claude can start other agents on new devboxes, message them, and leave notes for them in a shared project folder. You can share a read-only link to a thread with a teammate. Teammates you allow can also start work in your project from Slack, and that work runs with your access.

As of September 2026, the free trial includes 10 box-hours. Starter costs $19 per user each month, with 40 box-hours and up to four devboxes awake at once. Pro costs $99, with 250 box-hours and up to ten awake. Extra time costs $0.75 per box-hour on Starter and $0.60 on Pro. A box-hour is one default devbox awake for an hour, and sleeping devboxes don't use box-hours. Claude's usage counts toward your Claude plan. See Plans, seats, and box-hours.

To try it, connect Claude, then set up a project from a folder on your laptop or a GitHub repository.

How to choose

  • The task needs only your repository and common tools: Anthropic's cloud sessions, with nothing to run yourself.
  • You want a server that stays up at the lowest cost, your agents can share one machine, or you like running your own server: a VM you manage.
  • You want a wide choice of agents, or you want work to start from GitHub events: a managed platform.
  • You want the agent to run and test your full app, you want to work on the same machine, or you want Codex too: Boxes.dev.

You can combine them. Boxes.dev runs the same Claude Code CLI, so you can keep claude --cloud for quick tasks and use devboxes for work that needs your running app.

Frequently asked questions

Does Claude Code keep running when I close my laptop?

A local session stops while your laptop sleeps. Cloud sessions, a VM running tmux, managed platforms, and Boxes.dev all keep working after you close the laptop. Remote Control leaves the session on the computer where you started it, so that computer has to stay awake.

Can I use my Claude subscription on a cloud machine?

Yes. On your own VM and on boxes.dev, you sign in to Claude Code with your Claude account, and its usage counts toward your plan's limits. Anthropic's cloud sessions always use your subscription.

Can I run several Claude Code sessions at once?

Yes. Each of Anthropic's cloud sessions gets its own VM, and parallel sessions share your Claude plan's usage limits. Managed platforms also give each task its own machine. On a VM you manage, sessions share the server, so each one needs its own worktree and ports. On boxes.dev, each task runs on its own devbox with its own copy of your environment, and your plan sets how many devboxes can be awake at once.

Sources

Product names are trademarks of their respective owners.

Close your laptop again.

Develop in the cloud: one computer per agent, running your full app, steerable from every device you own.

Also oniOS·Android·CLI