Cloud Coding Agents Explained: Let AI Code While Your Laptop Is Closed
Claude Code cloud sessions, Codex Cloud, Copilot cloud agent, Grok Build and Devin: how cloud agents work and how to run them safely.

Key takeaways
- A cloud coding agent works in a vendor-run sandbox, so the task keeps going after you close your laptop and returns a branch or pull request.
- Claude Code cloud sessions, Codex Cloud, GitHub Copilot cloud agent, Grok Build cloud agents and Devin are the main options today.
- The main risks are secrets in the environment, open network access, costs from parallel runs and unread pull requests.
- Use a clear task, limited network access, test credentials only, a protected main branch and a spend limit for every unattended run.
- If you prefer local agents, keep the machine awake and watch the work from your phone instead.
A cloud coding agent is an AI agent that works on your code on someone else's computer: a virtual machine or container the vendor starts for each task. You describe the job, close your laptop, and come back to a branch or pull request to review. Claude Code, OpenAI Codex, GitHub Copilot, Grok Build and Devin all offer a version of this today.
This guide explains how cloud agents differ from the agent on your own machine, what each option offers right now, and how to set up an unattended run without leaking secrets or burning your budget.
Local, background and cloud agents
A coding agent needs three things: a copy of your code, a place to run commands, and a model to think with. Where that place is changes how you work.
- Local. The agent runs in your terminal, editor or desktop app. It sees your files and tools as they are, and you can step in at any moment. When the laptop sleeps, the work stops.
- Your own machine, unattended. The agent runs on a desktop or server you control, often over SSH, while you do something else. Your setup, your hardware, but it has to stay awake and online.
- Cloud. The vendor clones your repository into a fresh sandbox, installs dependencies with a setup script, runs the task and hands back a diff. Nothing depends on your laptop, and you can start several tasks at once.
Cloud agents shine for well-defined tasks you'd otherwise queue: fix this failing test, add pagination to this endpoint, update this dependency. They are weaker at work that needs your local database, a device on your desk, or lots of back-and-forth.
The main cloud coding agents today
| Option | Where it runs | How you start it | What you get back |
|---|---|---|---|
| Claude Code cloud sessions | Anthropic-managed VM, or your org's self-hosted environment | claude.ai/code, the Claude apps, or claude --cloud | A branch and diff; pull it local with --teleport |
| Codex Cloud | OpenAI cloud environment per task | ChatGPT web or desktop: Work in › Cloud; Codex on mobile | Changed files and test results; commit or open a PR |
| GitHub Copilot cloud agent | Cloud sandbox, a GitHub Actions runner, or a custom environment | GitHub.com, GitHub Mobile, GitHub CLI, the API or MCP | Proposed changes and a pull request |
| Grok Build cloud agents | Cloud agents, or your own machine over SSH | Grok Build desktop, web or terminal | Agent chats you review in the Agents Window or on the web |
| Devin | Cloud machines Cognition runs ("cloud Devins") | The Devin app, Slack, Linear, Jira and other integrations | Pull requests on your repository |
Claude Code in the cloud
Anthropic's cloud docs say cloud sessions are available on Pro, Max, Ultra and Team plans, and for Enterprise users with premium or Chat + Claude Code seats. A session keeps running after you close your laptop and you can steer it from any device, including the Claude mobile app. It counts toward your plan's usage limits with no separate charge for the VM. Each session runs in a cloud environment that sets network access, environment variables and setup scripts; network access is limited by default. GitHub credentials stay on Anthropic's servers and are attached by a proxy, so they never enter the VM. Organizations with Zero Data Retention or the HIPAA configuration can't use cloud sessions.
Codex Cloud
OpenAI's Codex Cloud docs describe tasks that each get their own workspace and keep working while your computer is asleep. You can publish a reusable environment with install scripts, choose how much internet access it gets, and add environment variables and HTTP secrets that only work for allowed domains. When it's done you inspect the changes, ask for follow-ups, and commit or open a pull request.
GitHub Copilot cloud agent
GitHub's Copilot cloud agent (formerly called the coding agent) researches a repository, plans and makes changes, and opens pull requests for you to review. Since 28 October 2026, the new Copilot in the cloud experience is available on paid Copilot plans, with three environment choices: a cloud sandbox, a GitHub Actions runner, or a remote custom environment. Cloud sandboxes honor repository and organization firewall allowlists. You can also run it from automations on a schedule or on repository events.
Grok Build
Cursor is now Grok Build. xAI's announcement lists cloud agents in the desktop app and on the web, computer use on cloud VMs, and agents over SSH that "keep working, even with your laptop closed". The pricing page includes "Cloud agents & automations" on Premium and higher plans. See how to use Grok Build.
Devin and Google Antigravity
Cognition describes Devin as an autonomous AI software engineer that plans, writes, tests and ships code inside your codebase and tools. Google Antigravity takes a different route: its subagents run concurrently in the background, optionally in their own Git worktree, while you keep working. That is asynchronous, but it runs where Antigravity runs, not in a vendor sandbox.
VS Code keeps your own machine working
If you'd rather keep agents on your own hardware, VS Code 1.148 (25 November 2026) added a preview setting, sessions.keepAwakeWhileWorking, that stops a supported agent host from idle-sleeping during agent work, even after you close the window. It defaults to only while plugged in. The same release adds experimental Dev Containers for agent sessions: an isolated Ubuntu container per task, without writing a container configuration first.
What can go wrong when nobody is watching
- Secrets. Anything you put in the environment, the agent can read and could print into a log or commit. A web page or issue it reads can contain instructions that try to make it send them somewhere (prompt injection).
- Network access. Full internet access makes installs easy and leaks easy. Most vendors default to a limited allowlist for a reason.
- Costs. Cloud runs use your plan's limits or paid credits, and parallel tasks multiply that. Check the current pricing page before starting ten at once.
- Review debt. Five agents can open five pull requests in an hour. If nobody reads them, you are back to vibe coding at scale.
- Scope creep. A vague task gives the agent room to touch files you didn't expect.
Checklist for a safe unattended run
- Write the task with a clear finish line: what should change, which test must pass, which files are off limits.
- Keep an AGENTS.md or CLAUDE.md in the repository with build and test commands, so the agent doesn't guess (see CLAUDE.md and AGENTS.md).
- Use the vendor's limited network setting and allow only the domains the task needs.
- Give the environment test or staging credentials only, never production keys.
- Let the agent push to a branch, never straight to main, and protect main with required checks.
- Set a spend limit or watch your usage page, and start with one task before you run several in parallel.
- Review the diff and the test output yourself before merging. Our guide to reviewing AI-generated code lists what to look for.
Watching local agents from your phone
Not every job needs a cloud VM. Ninja Builder runs coding agents (Claude Code, Codex, Gemini, Copilot, Cursor, Grok or a local model) on your own computer, so your files, terminal, Git and accounts stay there. Bigger jobs run as workflows of several agents in the Background work tray, with each agent's progress and token count. Schedules can run a prompt or playbook on their own, for example a nightly security check, as long as the app is open and the computer is awake.
The free iPhone app lets you follow that work while you're away from the desk: read replies as they arrive, see each chat's background work, answer a Needs your OK card, or press Stop. The phone and computer connect through Ninja Builder's relay, so you don't open any ports. Unlike a cloud agent, the computer has to be on; if it sleeps, the phone says so.


The background work docs and phone app docs cover the details. Download Ninja Builder to try it free for 14 days, then: $4.99 a month.
Frequently asked questions
Can Claude Code keep working when my laptop is closed?
Yes, in a cloud session. Anthropic's docs say a cloud session keeps running after you close your laptop and can be checked from any device, on Pro, Max, Ultra, Team and eligible Enterprise seats. A local session stops when the computer sleeps.
Do cloud coding agents cost extra?
It depends on the vendor. Claude Code cloud sessions count toward your plan's usage limits with no separate VM charge; other tools use plan limits, credits or higher plan tiers. Check each vendor's current pricing page before running many tasks.
Is it safe to give a cloud agent my API keys?
Only give it test or staging credentials, limited to the domains the task needs. Anything in the environment can be read by the agent and may end up in logs or commits.
What is the difference between a cloud agent and a background agent?
A background agent runs without you watching but can still be on your own machine, which must stay awake. A cloud agent runs on the vendor's infrastructure, so it doesn't depend on your computer at all.
Keep reading

How to review AI-generated code: a practical routine
Six steps, in the same order every time, to catch what AI coding agents get wrong before it reaches your main branch.

Agentic Engineering vs Vibe Coding: What's the Difference?
What agentic engineering means, how it differs from vibe coding, and the habits that take a project from one to the other.

How to Use Grok Build for Coding (Terminal, Desktop and Plans)
Install Grok Build, pick a plan, sign in and run your first task, then use plan mode, AGENTS.md, MCP and headless mode.