matrix.log / guides / claude-code-cloud
GuidesClaude Code
All articles

How to run Claude Code in the cloud

Run Claude Code on a remote computer so long tasks can continue through laptop sleep and local network disconnects.

Matrix OS8 min read

Claude Code Cloud: Keeping Your Agent Running When Your Laptop Is Off

Claude Code does its best work on long tasks. The problem is that long tasks and local machines are a bad combination.

When Claude Code runs locally, your laptop supplies the compute. Closing the lid usually suspends useful work, while a reboot or terminated process ends the run. A dropped network connection may interrupt model calls even if the local terminal remains open.

This article covers what running Claude Code in the cloud actually means, how to set it up in a persistent environment, and what changes about your workflow when the agent no longer depends on your device staying on.

The Problem With Running Claude Code Locally

This is not a compute problem. Most modern laptops have enough CPU and RAM to run Claude Code. The problem is availability.

Your laptop sleeps. It reboots for updates. You take it to a meeting. You travel. Any of these ends the session, and Claude Code does not pick up mid-task when you return — you restart from wherever the work stopped.

On a remote computer, a terminal multiplexer such as tmux or screen can keep the shell alive after an SSH or Wi-Fi disconnect. On the laptop itself, it cannot keep work moving while the operating system is asleep.

The deeper issue is that the session lives on your machine. When the machine is unavailable, so is the agent.

What "Claude Code Cloud" Actually Means

The right mental model is not "run Claude Code on a remote server." It is "give Claude Code a computer that never stops."

An SSH session on a remote server still depends on your connection staying alive unless you configure it carefully. A cloud computer built for persistent agent sessions is different. The session is the authoritative state. Your device is just a viewer. You connect, check progress, give direction, and disconnect. The agent keeps working.

Matrix OS provisions a dedicated VPS for each user on Hetzner hardware. Claude Code runs there in a persistent session. Close your laptop — the agent keeps running. Reconnect from a phone browser, a different laptop, or a desktop at the office, and the session is exactly where you left it: same files, same running processes, same context.

This is not a sandbox that resets between tasks. It is not a CI runner that spins up and tears down. The VPS persists across reboots and disconnects. When you reconnect, Claude Code is not restarted from scratch. It is still running.

Setting Up Claude Code on a Persistent Cloud Session

Sign up at matrix-os.com, provision a machine on the tier that fits your workload, and you get a full web shell with terminals, a file manager, previews, and agent sessions. No local configuration required beyond pointing Claude Code at the environment.

From there, Claude Code runs in a persistent terminal session on the VPS. Access it via the web shell from any browser, or via the Matrix CLI from any terminal. Either way, the session on the VPS is the authoritative one. Closing the browser tab does not affect it.

Choosing the Right Tier

Three tiers are available, backed by Hetzner compute:

  • Starter — 2 vCPU, 4 GB RAM, 80 GB disk at $14/month. Sufficient for single-agent tasks and smaller codebases.
  • Builder — 4 vCPU, 8 GB RAM, 160 GB disk at $19/month. A better fit if you run Claude Code alongside other processes, work across multiple repos, or want headroom for longer tasks.
  • Max — 12 vCPU, 24 GB RAM, 480 GB disk at $49/month. Designed for parallel agent workloads, larger codebases, or running several agents at once.

For most developers running Claude Code continuously on a single codebase, Builder is the right starting point. Starter handles lighter workloads well. Max makes sense when you are running Claude Code alongside Codex, Gemini CLI, or other agents simultaneously.

Attaching to a Running Session

Once your VPS is provisioned, open a terminal in the web shell and start Claude Code. The session runs on the VPS. Close the browser — the process continues.

When you return, open the web shell and reattach to the running terminal. Claude Code is still there. If it finished a task, the output is in the file system. If it is mid-task, you can inspect progress, give new direction, or leave it running.

The Matrix CLI gives you the same access from any terminal — one command attaches you to the running session on your VPS, with full persistence across disconnects.

The mobile web shell works now too, so you can check on a running session from your phone without waiting to get back to a laptop.

Running Multiple Agents in Parallel

One of the less obvious benefits of a persistent cloud computer is that it is not tied to any single agent. Claude Code, Codex, Cursor, Gemini CLI, OpenCode, and Pi can all run in isolated sessions on the same VPS, against the same file system.

That means Claude Code can work on a bug fix in one terminal while Codex handles a documentation pass in another. Changes from one agent are immediately visible to the other because they share the same persistent environment — no syncing, no copying files between environments.

Symphony, Matrix's orchestration layer, adds structure to this. Queue tasks, track agent status across sessions, review branches and diffs, and hand off between agents with a human-in-the-loop step before anything gets merged. The workflow becomes: task in, reviewed change out.

This is the core idea behind the cloud computer for agents model: the persistent machine, not the session, is the durable unit. Agents come and go. The environment stays.

Scheduled Workflows With Hermes

Beyond interactive sessions, Matrix includes Hermes — a resident agent that handles scheduled workflows without manual intervention. Configure it to run Claude Code on a recurring basis: nightly dependency checks, weekly CI summaries, automated triage of Sentry errors, or any other repeating task.

Hermes executes those workflows on the VPS and connects to GitHub, Linear, Slack, Discord, Gmail, Datadog, or Google Calendar as needed. It handles notifications and approvals, so you get a summary in Slack rather than a stalled terminal you have to check manually.

This is the difference between an agent you run and an agent that runs. The VPS is always on. Hermes uses that availability to do background work while you are focused elsewhere.

How This Compares to Other Approaches

Raw VPS

You can set up a VPS yourself, configure tmux, install Claude Code, and manage everything manually. This works. The honest framing is not that a raw VPS cannot do this — it is that maintaining the infrastructure behind your agents should not become another engineering job. Matrix OS handles provisioning, session management, the web shell, and integrations so you can focus on the work rather than the plumbing.

E2B and Daytona

E2B provides API-created sandboxes with configurable lifecycles. Matrix OS provides a named computer intended to retain project state across tasks. Compare current limits and prices in each provider's documentation.

Daytona provides development infrastructure and isolated workspaces. Evaluate its current lifecycle, persistence, and pricing against the duration and state your project requires.

Cursor and IDE-Based Agents

Cursor is an editor product with managed Background Agents that run remotely. They continue independently of the laptop, but Cursor owns that runtime; it is not an arbitrary computer where you install any terminal agent.

Cursor Background Agents already run in Cursor-managed remote environments. Matrix OS is complementary when you want to run terminal agents on a computer you can access directly; it does not host Cursor's managed Background Agent runtime.

Privacy and Ownership

Each Matrix workspace is isolated — your files, your database, your runtime. No shared host kernel, no co-tenancy with other users' workloads. The workspace is exportable, so you are not locked into the platform.

For developers working with proprietary codebases or client data, this matters. The agent runs on hardware provisioned for you, not on shared infrastructure where isolation is a software boundary.

The architecture is covered in more depth in the canvas-first workspace post, which explains how the persistent environment shapes the way you interact with running agents.

What Changes About Your Workflow

The practical shift is that Claude Code stops being something you run and starts being something that runs. Queue a task before a meeting. Check the output when you get back. Close your laptop at night and open it in the morning to finished work.

Long-running tasks stop being a liability. A multi-file refactor that takes two hours is not something you have to babysit. A nightly dependency audit is not something you have to remember to kick off. The agent works on the VPS while you are doing other things.

Your device becomes a viewer. The work lives in the cloud.


FAQs

Does Claude Code keep running if I close my laptop?

Yes. When Claude Code runs on a Matrix OS VPS rather than your local machine, closing your laptop has no effect on the session. The agent continues running on the cloud computer. Reconnect from any device when you want to check progress or give new direction.

What happens to my Claude Code session if I lose my internet connection?

The session on the VPS is unaffected by your local connection dropping. Claude Code keeps running. When your connection is restored, reattach to the same session via the web shell or the Matrix CLI — the session state is preserved.

Can I run Claude Code and other agents at the same time on Matrix OS?

Yes. Claude Code, Codex, Gemini CLI, Cursor, OpenCode, and Pi can all run in isolated sessions on the same VPS simultaneously. They share the same file system, so changes from one agent are immediately visible to others.

Is Matrix OS just a VPS with tmux?

No. A raw VPS with tmux requires you to provision the machine, configure the environment, manage sessions, and build any integrations yourself. Matrix OS provides the persistent compute, the web shell, CLI access, the Symphony orchestration layer, the Hermes resident agent, and integrations with GitHub, Linear, Slack, Sentry, and others. The infrastructure is managed so it does not become another engineering job.

What tier do I need to run Claude Code continuously?

For most individual developers running Claude Code on a single codebase, Builder at $19/month is a reasonable starting point. Starter at $14/month works for lighter workloads. Max at $49/month is designed for parallel agent workloads or larger codebases.

Can I access my running Claude Code session from my phone?

Yes. The Matrix OS mobile web shell is available now, so you can check on a running session, review output, or give new direction from a phone browser without needing a laptop.

How is Matrix OS different from E2B for running Claude Code?

E2B is designed around programmatically managed sandboxes. Matrix OS is designed around a persistent computer and workspace. Check each provider's current lifecycle controls and prices; the important difference is the operating model, not a plan snapshot.


Running Claude Code in the cloud is not a configuration trick. It is a different model: the agent lives on a computer that never stops, and your devices are just windows into that work. If you have tasks that outlast your attention span or your laptop's uptime, that is the right model to move to.

Start at matrix-os.com to provision your persistent cloud computer.