Claude Code Cloud: Cloud Sessions vs VPS vs Workspace

Claude Code cloud sessions, a self-managed VPS, or a persistent cloud workspace. Compare what each keeps, what it costs, and which one fits how you work.

PandaSIFirst published on
An oil painting of a closed laptop on a wooden desk at dusk, while through the window a small cabin on a distant hill keeps glowing with work
The laptop is closed. The work keeps going somewhere else.

Short answer: there are three practical ways to run Claude Code in the cloud. Anthropic's own Claude Code cloud sessions (claude.ai/code or claude --cloud) give you a managed VM per session at no extra charge on paid plans. A self-managed VPS gives you a Claude Code server you fully control, if you are willing to run it. A persistent cloud workspace such as PandaSI Agent Cloud sits in between: a private Linux machine that keeps your files and tools, pauses when idle, and runs Claude Code and Codex. Pick by one question: does your work need to survive between tasks?

Claude Code cloud sessions Self-managed VPS PandaSI Agent Cloud
Who runs the machine Anthropic (or your org's self-hosted environment) You PandaSI
Starting state Fresh VM with a clone of your repo per session; setup-script results can be cached Whatever you installed Your own disk, kept between sessions
What persists The session, its branch, and the cached setup environment Everything, until you break it /home/agent and workspace files; system packages reset on image upgrades
Repo hosting GitHub on Anthropic-hosted VMs (other hosts via local bundle); Team/Enterprise self-hosted runners (terminal sessions via --environment) can clone and push branches to other Git hosts (PRs stay GitHub-only) Any GitHub built in, or any Git host via HTTPS token
Engines Claude Code Anything you install Claude Code and Codex (configurable default for new sessions)
Idle behavior VM pauses when idle and may later be reclaimed Keeps running and billing Pauses after 5 min idle, wakes on the next message
Cost model Counts toward your Claude plan limits, no VM charge VPS bill + your Claude plan or API key Subscription tier with included monthly hours
Setup effort Minutes Install, configure, then maintain Minutes

Facts about Anthropic's product come from the official cloud sessions, cloud environments and Remote Control documentation, checked on 2026-12-05. PandaSI facts come from our own product and pricing page. We build PandaSI, so weigh our section accordingly; each option below gets its honest reasons to pick it over ours.

1. Claude Code cloud sessions (Anthropic's official option)

A cloud session is a Claude Code session that runs on infrastructure Anthropic manages, or on your organization's self-hosted environment. You start one from claude.ai/code, the Code tab in the Claude mobile app, the Desktop app, or the terminal:

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

The session keeps running after you close your laptop, and you can pull it back into your terminal with --teleport. Per the docs, handoff from the CLI is one-way: you can teleport a cloud session down to your machine, but not push a running local session up.

Each Claude Code cloud environment can have a setup script. When it finishes within roughly five minutes, Anthropic snapshots the filesystem and reuses that snapshot for later sessions for about seven days, so installed packages, dependencies and Docker images are already on disk. Running processes, such as a database the script started, are not kept, and packages Claude installs mid-session do not carry over to other sessions.

Pick it over a workspace like ours when:

  • Your code is on GitHub and each task starts from a clean checkout anyway. A fresh VM per session is a feature here, not a limitation.
  • You already pay for Pro, Max, Ultra or Team. There is no separate VM charge; usage counts toward your plan limits.
  • You want Anthropic-native features such as auto-fixing pull requests and cloud scheduled tasks (formerly routines) that start sessions on a schedule, by API call, or from GitHub events.

Where it stops fitting:

  • --cloud requires an Anthropic account and is not available when Claude Code is configured for Amazon Bedrock, Google Cloud's Agent Platform, or another third-party provider.
  • Repository cloning in Anthropic-hosted environments requires GitHub. A GitLab, Bitbucket or other repository can be sent as a local bundle (under 100 MB, using CCR_FORCE_BUNDLE=1), and a bundled session can push back only to a GitHub remote it has push access to. Team and Enterprise self-hosted environments (in beta) are the exception for sessions started from the terminal with --environment: a runner with non-interactive git credentials and network access to your host can clone from and push branches to other Git hosts, while pull request creation stays GitHub-only.
  • Changes made by hand during a session, running services and anything outside the setup script start over in the next session.
  • It runs Claude Code only. If part of your team works in Codex, that work lives somewhere else.

2. A self-managed Claude Code VPS

The do-it-yourself route: rent a Linux VPS, install Claude Code, and keep sessions alive inside tmux. Anthropic's install script works on a plain Ubuntu or Debian box:

bash
sudo apt-get install -y tmux
curl -fsSL https://claude.ai/install.sh | bash
claude auth login      # log in on the server itself
tmux new -s agent      # then run: claude
                       # detach with Ctrl-b d, reattach with: tmux attach -t agent

To reach that session from a phone or browser, Anthropic's Remote Control connects the Claude app or claude.ai/code to a Claude Code session running on your server, using outbound HTTPS only, so you do not open inbound ports for it. It requires a claude.ai subscription: API keys, Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and custom ANTHROPIC_BASE_URL gateways are not supported, and it does not cover Codex.

Pick it over a workspace like ours when:

  • You need custom kernels, GPUs, or a specific region and provider for compliance.
  • You already run servers and are comfortable maintaining one more.
  • You want any engine, model gateway or API key setup with no product in between.

What it costs you in practice. Self-managed servers require ongoing maintenance. The common failure modes are operational, and some of the disconnect cases we have debugged are in Claude Code remote disconnects:

  • The machine bills while you sleep. A VPS does not know your agent is idle.
  • Phone access depends on your setup. Remote Control covers Claude Code on a Claude subscription; with API keys, third-party providers or Codex you need SSH or your own tooling.
  • Exposed ports are your problem. Any preview server or dashboard you open on a public IP needs its own hardening.
  • Upgrades break quietly. CLI auto-updates, Node versions and login tokens drift, and you find out when the agent stops answering.

3. A persistent cloud workspace (PandaSI Agent Cloud)

PandaSI Agent Cloud is a private Linux machine per account that runs Claude Code and Codex and is controlled from the PandaSI Agent page in a browser, the desktop app, or iPhone. It is the option for work that needs to remember things between tasks: an installed toolchain, a half-finished branch, a local database (services freeze and are unreachable while paused, and may need restarting after a full stop, cold start or image upgrade).

PandaSI Agent page in English: the connection menu lists My Agent Cloud under a My Agent Cloud heading with a Ready badge, above other paired machines, and the Agent Cloud panel shows Resume plus default engine Codex, provider PandaSI, model and reasoning effort
The Agent page on pandasi.ai, captured 2026-12-05. Agent Cloud is listed separately from paired machines and shows Ready while paused. Machine names, project and session titles and the GitHub account are replaced with placeholders.

How it behaves, as shipped today:

  • It pauses on its own. Agent Cloud pauses about 5 minutes after the last agent turn ends, with a notice a minute before, and wakes automatically when you send a message. A turn that is still running keeps it awake; a background script left running after the turn ends does not, so keep long jobs inside an agent turn.
  • Your files stay. Workspace files and /home/agent are kept across pauses, stops and system image upgrades. Changes outside /home/agent, such as packages installed with apt, are reset when you upgrade the system image, so install user-level tools under your home directory.
  • Claude Code and Codex on the same machine. Pick the engine when you start a new session, and set a default engine and model in the Agent Cloud panel. Each session stays bound to the engine it was created with.
  • Runtime hours come with the tier. Each subscription tier includes an Agent Cloud with fixed specs and monthly runtime hours. When the included hours run out, the machine pauses until the next period or a plan upgrade.
  • Data has a clock if you leave. If the subscription ends, the machine stops and its data is deleted after 15 days unless you resubscribe.
Illustration: Agent Cloud goes from Active to Paused after 5 minutes idle with a one-minute notice, and the next message wakes it; /home/agent and workspace files persist, system apt packages reset on image upgrade
Illustration. What pauses, what wakes, and what survives an image upgrade.

Pick one of the other two over ours when:

  • Your work fits a fresh GitHub checkout per task and you already pay for a Claude plan: Anthropic's cloud sessions cost you nothing extra.
  • You need custom kernels, GPUs or a specific provider: a VPS is the honest answer.
  • You only need a few hours of cloud time a month and already have a machine at home that stays on: pairing that machine is cheaper than any hosted option.

How to choose in one minute

Illustration: decision flow. Need custom kernels, GPUs or a specific region leads to a self-managed VPS; if not, a fresh GitHub checkout per task leads to Claude Code cloud sessions; if not, needing state between tasks with Claude Code and Codex in one managed UI leads to a persistent workspace
Illustration. Three questions, asked in order.
  1. You need custom kernels, GPUs or a specific region? Rent a VPS and budget time for upkeep.
  2. Every task starts from a clean GitHub checkout? Use Claude Code cloud sessions.
  3. Your agent needs yesterday's state, and you want Claude Code and Codex in one managed UI? Use a persistent workspace.

Many people end up with two: cloud sessions for quick PR fixes, and a persistent machine for the long-lived project. If you run several streams of work on one machine, see running multiple sessions on one cloud agent.

Verify your setup works

Whatever you choose, run the same three checks before trusting it with real work:

  1. Close the laptop for 15 minutes, then reopen the session from a different device. The conversation and the agent's last output should be there.
  2. Ask the agent to run pwd and git status. Confirm it is in the directory and branch you expect.
  3. Come back the next day and check what survived: installed tools, uncommitted changes, caches. This is the test that separates the three options.

FAQ

Is Claude Code cloud free?

Anthropic does not charge separately for the cloud VM. Cloud sessions are available on Pro, Max, Ultra and Team plans (and some Enterprise seats) and count toward the same usage limits as the rest of your Claude usage.

Can Claude Code run in the cloud without GitHub?

Yes, with limits. Anthropic-hosted sessions accept a non-GitHub repository as a local bundle under 100 MB but can push only to an authorized GitHub remote. Team and Enterprise self-hosted runners, for sessions started from the terminal with --environment, can clone from and push branches to other Git hosts when configured with the required credentials and network access; pull request creation stays GitHub-only. On a VPS or a persistent workspace, you configure git yourself, so you can use any Git host.

Does a Claude Code cloud environment keep my installed tools?

What your setup script installs is cached as a filesystem snapshot for about seven days, so new sessions start with it on disk. Tools installed by hand during a session do not carry over. A VPS or a persistent workspace keeps them on disk; on Agent Cloud, system-level packages still reset on image upgrades.

What is the best Claude Code VPS?

Any Linux VPS with enough memory for your project's build and test runs will do; the CLI itself is light. The bigger choices are operational: how you keep sessions alive (tmux), how you reach them from a phone (Remote Control on a Claude subscription, or SSH), and who patches the machine.

Can I run Codex and Claude Code on the same cloud machine?

On a VPS, yes, you install both. On PandaSI Agent Cloud, yes: you can run Claude Code and Codex sessions on the same machine, picking the engine per session and setting a default in the Agent Cloud panel. Anthropic's cloud sessions run Claude Code only.