Explainer

Cloud Agents vs Local Agents: Where Should Coding Agents Run?

Where an agent runs decides what it can touch, what it costs, and whether it stops when you close the lid.

Last updated · By

Run an agent locally when it needs what's on your machine: your simulators, local services, VPN, hardware, or a fast back-and-forth while you watch. Run it in the cloud when it needs to keep going after you close the laptop, when you want more parallel tasks than your machine can hold, or when you start work from your phone. Most teams end up using both, and the main choice is whose cloud: a vendor's (Codex Cloud, Claude Code cloud sessions, Devin) or one you own (an SSH dev box or a VM on your own cloud account).

We checked every product claim below against first-party documentation on October 9, 2026.

Local vs vendor cloud vs your own cloud#

Local (your Mac)Vendor cloudYour own remote or cloud
ExamplesClaude Code or Codex in a local worktree or containerCodex Cloud, Claude Code cloud sessions, Devin, Cursor cloud agents, GitHub Copilot coding agentSSH dev box; VMs on Modal, Fly.io, or Vercel Sandbox
Keeps running with the laptop closedNoYesYes
Access to local toolsEverything on your machineWhat the environment installsWhat you install
Which agentAny CLIThe vendor's agentAny CLI
Where code and secrets liveYour machineVendor infrastructure (some offer self-hosted environments)Machines and accounts you control
Parallel capacityLimited by CPU, memory, and portsHighHigh
CostYour agent subscriptionPlan usage or quotasYour compute bill plus your agent subscription
SetupNone beyond the repositoryEnvironment settings: network, variables, setup scriptA machine image or setup script

Vendor clouds#

Each major coding agent now has a hosted mode. They differ mostly in how you start work and what the environment can reach.

  • Codex Cloud. OpenAI announced at DevDay 2026 that Codex Cloud runs tasks while your laptop is closed, with access across devices. In the Codex app it sits beside local, worktree, and SSH modes.
  • Claude Code cloud sessions. A cloud session runs on Anthropic-managed infrastructure or your organization's self-hosted environment. Start one from claude.ai/code, the Claude mobile app, the desktop app, or claude --cloud, and move work between your terminal and the cloud with --cloud and --teleport. Each session uses a cloud environment that sets network access, environment variables, and setup scripts. Routines run scheduled and triggered work the same way. Cloud sessions need a Pro, Max, Team, or eligible Enterprise plan.
  • Devin. Each Devin session runs on its own VM with a desktop, browser, and computer use, and keeps working after you close your laptop.
  • GitHub Copilot coding agent. Assigned issues run in an ephemeral, GitHub Actions-powered environment and come back as a pull request.
  • Cursor cloud agents, Factory Droid Computers, and Ona environments follow the same pattern with their own agents; see the best AI software factory tools.

The tradeoff is the same in every case: the vendor runs the machine, so you get their agent, their environment model, and their limits.

Your own remote machine or cloud account#

You can get the same "keeps running" property without handing compute to an agent vendor:

  • An SSH dev box. Any Linux or Mac machine you keep online can run agent CLIs. In Agentastic, add it as a remote machine and agents get full source control, terminals, and worktrees there.
  • Cloud VMs on your account. Agentastic's cloud agents launch on Modal (good for short-lived tasks), Fly.io (longer-lived, region-pinned machines), or Vercel Sandbox microVMs, using credentials you add under Settings. Agents keep running after you close your Mac, Sync Down from VM pulls their changes into your local worktree, and per-provider guards destroy idle VMs (after 800 seconds by default) and end any VM at a hard timeout (eight hours by default).

This route keeps the agent choice open (Claude Code, Codex, Gemini CLI, or anything else) and bills compute to accounts you already manage.

When local is the right call#

  • UI and mobile work that needs the iOS Simulator, Xcode, or a browser on your machine.
  • Tasks that touch local services: a database with real-ish data, a VPN-only API, hardware.
  • Short, interactive tasks where you want to watch and steer; local is the fastest feedback loop there is.
  • Code that can't leave your machine for contractual or regulatory reasons.

Locally, isolate each task in its own git worktree, and use a container when it needs its own services or network rules.

When the cloud is the right call#

  • Long runs: migrations, large refactors, full test suites, anything that takes longer than you want your laptop awake.
  • Overnight and scheduled work: a nightly bug hunt or weekly dependency pass shouldn't depend on your lid being open. See loop engineering.
  • More parallel tasks than your machine can hold: ten agents each running a dev server will exhaust ports and memory long before they exhaust ideas.
  • Starting work away from your desk, from a phone or another computer.

Patterns that combine both#

  • Plan locally, execute remotely. Shape the task interactively, then send the long execution to a cloud session or VM and review the branch when it's done.
  • One environment definition everywhere. Keep setup in a script in the repository, such as .agentastic/setup.sh or a cloud environment's setup script, so a task behaves the same on your Mac and in the cloud.
  • Review where you are. Cloud results come back as branches, pull requests, or changes you sync down into a local worktree; review them in your normal diff tool, or from your phone with the iPhone Companion.

Security and cost checklist#

  1. Give cloud environments the least network access and fewest secrets that still let tests run.
  2. Use repository-scoped tokens; Anthropic, for example, keeps GitHub credentials out of the session VM and routes git through a proxy.
  3. Never let a cloud agent merge its own work. The GitHub Copilot coding agent, for one, can't approve or merge its own pull requests.
  4. Set lifecycle limits so idle VMs shut down, and cap turns or tokens per task.
  5. Compare cost per merged change across local and cloud runs, not just per-hour compute prices.

Sources#

Frequently asked questions#

What is a cloud coding agent?#

A cloud coding agent runs on a remote machine instead of your laptop: it clones your repository into a sandboxed environment, does the work there, and hands back a branch or pull request. Codex Cloud, Claude Code cloud sessions, Devin, Cursor's cloud agents, and the GitHub Copilot coding agent all work this way. Vendors also call them background agents.

Do cloud agents keep running when my laptop is closed?#

Yes, that is their main advantage. Local agents stop when your machine sleeps. Cloud agents, and agents on a remote machine or a cloud VM you own, keep working and can be checked from a browser or phone.

Can Claude Code run in the cloud?#

Yes. Claude Code cloud sessions run on Anthropic-managed infrastructure or your organization's self-hosted environment. You can start them from claude.ai/code, the Claude mobile app, the desktop app, or claude --cloud, and move a session between your terminal and the cloud. They need a Pro, Max, Team, or eligible Enterprise plan.

What is Codex Cloud?#

Codex Cloud is OpenAI's hosted environment for Codex tasks. Announced at DevDay 2026 as running tasks while your laptop is closed, with access across devices, it sits beside local, worktree, and SSH modes in the Codex app.

Are cloud coding agents secure?#

They can be, with care. Check what network access the environment has, which secrets it receives, and what the agent can push. Anthropic, for example, keeps GitHub credentials out of the session VM and routes git operations through a proxy. Review every cloud agent's branch before it merges, as you would a contractor's.

Can I run coding agents on my own cloud account?#

Yes. You can run agent CLIs on any remote machine you control over SSH, and Agentastic can launch agents on cloud VMs in your own Modal, Fly.io, or Vercel Sandbox account, so compute is billed to you and the agent is whichever CLI you choose.

Run agents locally and in your own cloud from one app

Agentastic is free on macOS. Run agents in worktrees and containers on your Mac, on SSH hosts, or on cloud VMs in your own Modal, Fly.io, or Vercel Sandbox account.

Try Agentastic on macOS