Hands Off Development

Runtime Requirements Claude Code and Codex Actually Need When Lifted Off a Laptop

Moving coding agents to the cloud means supplying memory, disk, sessions, network, and credentials.

· 9 min read
Cover illustration for “Runtime Requirements Claude Code and Codex Actually Need When Lifted Off a Laptop”
Cloud Agent Environments · November 26, 2026 · 9 min read · 1,916 words

Moving Claude Code or Codex from developer laptops to the cloud requires an execution environment. Teams must provision memory for builds, persistent disk, durable sessions, controlled outbound access, scoped credentials, and isolation for each agent. The choice between a self-hosted VM, managed cloud sessions, and a coding-agent platform is who supplies those requirements and who governs them.

What coding agents actually do at runtime — and what that implies for infrastructure

Claude Code and Codex are thin CLI processes that call model APIs remotely. Inference happens on the provider’s side. The host machine executes shell commands, runs builds, writes files, and manages context, so its resource requirements come from the agent harness and the work it launches. Moving that harness to a VM moves the development workload there.

On a laptop, the surrounding environment already supplies persistent home directories, outbound internet, process management, and credential storage. The developer rarely configures these specifically for an agent. A cloud VM makes those dependencies explicit because its disk, network policy, authentication, and lifecycle may differ from the laptop’s. An agent that worked locally can therefore fail remotely even when the CLI installation is correct.

Memory limits — why 4 GB causes out-of-memory failures under real workloads

An agent can disappear mid-session without an error message the developer recognizes when its host runs out of memory. The failure interrupts the task rather than producing a useful explanation of the resource shortage. Remote inference does not prevent this. Builds and tests still consume the VM’s RAM, and sizing only for the CLI leaves those workloads competing for an allocation intended merely to start the agent 512.

Claude Code’s official minimum is Ubuntu 20.04 or later and 4 GB of RAM. A machine with that minimum can start the harness but still fail when it runs the repository’s build and test suite. The practical sizing target is therefore the development workload, with 8 GB as the comfort floor rather than an assumption that the published minimum will suffice.

Swap can soften the failure on a 4 GB machine by allowing a hungry build to continue at reduced speed and avoid being killed 512. Swapping to disk under agent workloads degrades throughput significantly, so it does not turn a constrained instance into a suitable default.

Codex cloud makes resource allocation part of its plan structure, with smaller vCPU and memory allocations on the entry tier and more on higher tiers. Managed execution still has resource limits. Those limits become a product selection criterion. Architecture is a separate choice because Claude Code ships ARM64 builds, and ARM instances tend to cost less but still need enough memory for the work.

Persistent disk — what the agent loses when the filesystem resets between sessions

When the filesystem resets, it can lose sign-in credentials, conversation history, settings, and intermediate files. These are part of the working environment. Claude Code stores credentials, settings, and history under ~/.claude, so wiping that directory means signing in again and losing the history that claude --continue reads.

For a self-provisioned VM, the root disk must persist across stops, restarts, and SSH disconnections, with documented data durability. The team owns that persistence contract. Keeping a VM available and retaining its disk are infrastructure responsibilities.

Anthropic-managed cloud sessions save files and pause the VM after a few minutes of inactivity, then restore the same VM on the next message. A reclaimed VM follows a different path. When the service rebuilds it, conversation history survives, but background commands that were still running do not return.

Repository state also needs more than a directory upload. Tools such as beam vm sync omit .git, so an agent expected to commit changes needs a proper clone with git history. Committed files such as CLAUDE.md and .claude/settings.json travel with that clone. User-level configuration under ~/.claude/CLAUDE.md and user-scoped MCP servers do not, and must be provisioned separately where supported.

Session survival — why a plain SSH session is not enough to keep an agent running

An agent started in a plain SSH session can be killed when that connection closes, making network connectivity part of its lifecycle. The standard self-hosted workflow uses tmux to separate the two. The developer connects over SSH, starts a tmux session, and launches the agent inside it.

Once the agent is running, the developer detaches with Ctrl-b d before closing the SSH connection. The tmux session remains on the VM. Later, the developer connects again and reattaches to that session, including from another device.

Anthropic-managed sessions provide a different attachment model. Work continues after the laptop closes, and the developer can reconnect through a browser, mobile app, desktop app, or terminal without tmux. Scheduled parallel work also needs a way to start agents without a person there. Agents must start without a person at the keyboard, complete their task, and return a reviewable pull request. Interactive first-run prompts must be handled before headless operation.

A surviving process also needs access to its dependencies. Claude Code makes outbound HTTPS requests and requires no inbound ports for its own operation, but its outbound needs include package registries such as npm, pip, and cargo, GitHub and GitLab, cloud SDKs, and the Anthropic API endpoint. A locked-down environment must have rules that allow access to the destinations the agent needs. Otherwise, a task can stop midway with an opaque network error even though the process itself remains healthy.

Anthropic’s cloud environment documentation lists network policies that include None, Limited, and Full. None prevents outbound connections, while Limited provides default access to package registries, GitHub, and cloud SDKs, plus domains the team adds. Full permits any domain. Self-hosted teams instead own firewall configuration, the choice of reachable registries and APIs, and the audit of what an agent can call.

Anthropic-managed outbound traffic passes through a security proxy, while GitHub traffic additionally uses a proxy that exchanges a scoped credential for the real token outside the VM. The GitHub proxy rejects tag pushes and branch deletions, but does not restrict which branches can be updated. That distinction leads directly to credential governance because access through a proxy is not, by itself, a complete policy for repository changes.

Credential handling — why storing secrets in environment variables on a cloud VM is insufficient

On a laptop used by one person, credentials often live in the developer’s shell profile or keychain. Moving that setup to a VM the team can access changes who can see the credentials. Environment variables are readable by anyone who can access the environment, and Anthropic’s cloud environment documentation warns against storing secrets there. Moving execution requires reconsidering where the secret exists.

With Anthropic’s network secrets mechanism, the key stays outside the session. A key is registered against a list of hostnames, and the proxy attaches it to outbound requests after they leave the VM. It never appears in the session’s environment variables or files.

For repository access on a self-hosted VM, the recommended credential is a deploy key or a fine-grained token scoped to one repository. A personal SSH key should not be copied to the server. For agent authentication, the team must also choose between subscription login, an API key, and a token. Subscription login needs the developer to go through a browser-based flow on their laptop, while API keys work with non-interactive automation and tokens work with scripts, CI, and unattended machines.

That choice must precede unattended agent startup. A server cannot complete the default browser flow on its own, and Anthropic-managed cloud sessions do not support interactive authentication such as AWS SSO. Authentication that works on a developer’s machine is therefore not evidence that the cloud workflow is ready. The supported path must fit both the agent and the services its task requires.

Central credential management also defines what autonomous work may do. Agents should not have credentials that let them merge directly to main, approve their own pull requests, or use services beyond those needed for the current task. Separate execution environments provide the other boundary, preventing one session’s exposed credentials from becoming shared state for another.

Process isolation — why each agent session needs its own VM rather than a shared one

Parallel agents on a shared VM can interfere with filesystem writes, build caches, environment variables, and running processes. Separate terminal sessions do not remove that shared state. The required model is one isolated VM, or equivalent sandbox, per agent session, with its own kernel, disk, and network identity. A runaway build, out-of-memory event, or compromised workspace should affect only that execution environment.

Anthropic-managed sessions make the separation explicit by starting each session in a fresh VM cloned from the repository. Committed configuration is available, while installations and settings found only on the developer’s machine are absent. Freshness exposes hidden dependencies. It also gives teams a defined starting point rather than relying on the accumulated state of a developer laptop.

Setup scripts set up the environment before Claude Code starts. These Bash scripts run as root and can install dependencies or fetch configuration so sessions begin from the same baseline. Standardization and isolation serve different purposes here. The script supplies what each workspace needs, while the VM boundary prevents one workspace’s activity from becoming another’s runtime state.

For enterprise teams, that boundary also supports compliance. A VM shared by several projects cannot show the same separation of credentials, code, and data that isolated workspaces can. Isolation does not replace human authorization, however. Autonomous agents should investigate and propose changes through draft pull requests, with required human review, protected main, and merge permission reserved for humans.

The pull request is the deliberate handoff point. It returns control to a person after the agent has investigated, changed files, and run its checks. Isolated execution and required review can give cloud agents stronger boundaries than the laptop model.

How do teams move Claude Code or Codex off laptops into cloud VMs?

Diagram: Self-Hosted vs. Managed vs. Platform: Who Owns What. Visualizes: Show three deployment options for running Claude Code/Codex in the cloud — Self-Hosted VM, Anthropic-Managed Sessions, and Purpose-Built Platform (e.g.

For teams choosing the self-hosted path, the practical baseline is 8 GiB RAM, 2–4 vCPUs, and 50 GiB of persistent disk on Ubuntu 24.04 LTS. The 4 GiB absolute floor is insufficient for real workloads. The environment also needs tmux or an equivalent process supervisor, a non-root user, SSH key authentication, and password login disabled. Each concurrent agent session needs its own VM to keep state separate between parallel runs.

The network and credential specification completes that baseline. Outbound HTTPS must reach the required package registries, GitHub, and the Anthropic API endpoint, with no inbound ports beyond SSH. Repository access should use deploy keys or fine-grained tokens, without personal SSH keys or secrets in environment variables. These controls must be provisioned with the machine, rather than left for an agent to discover during a task.

Anthropic-hosted sessions supply fresh isolated VMs, proxy-layer credential handling, and setup scripts, but the team still configures network access and registers secrets. Managed does not mean configuration-free. Interactive authentication and locally stored user-scoped MCP servers remain unsupported, so those dependencies distinguish a suitable managed workflow from one that needs a different environment.

Replicas is another option, provisioning isolated Linux VMs for Claude Code, Codex, and other harnesses, integrating with Slack, Linear, GitHub, and GitLab, and returning reviewable pull requests with bring-your-own model keys and usage-based compute.

The engineering lead’s decision is where these responsibilities belong. A self-hosted VM leaves assembly and operation with the team, managed sessions supply a defined execution model, and a purpose-built platform adds team controls such as audit logs, parallel agent management, and credential governance. None makes memory, persistence, process survival, connectivity, credentials, or isolation optional.

Sources

  1. How to run Claude Code in the cloud: 5 options compared

More in Cloud Agent Environments