Bivy

Keep Claude Code or Codex running after you close your laptop

Checked 16 November 2026

A coding agent runs where its process runs. If that process is on your laptop and the laptop sleeps, the agent stops. Remote access doesn't change that: a phone app can show you the session, but it can't make a sleeping machine run code. To keep working, you either keep the laptop awake or run the agent somewhere else.

The short answer: for one long task at your desk, keep the laptop awake and plugged in. If you already have a machine that stays on, run the agent there in tmux. If the repo is on GitHub and the task needs no local services, use Claude Code cloud sessions or Codex cloud. For several agents on a machine that stays on, steered from your phone, look at Bivy on your own machine or a Bivy cloud computer.

This page is published by Bivy, which is one of the options. Each claim below comes from the product's own docs, site or manual page, linked under Sources. Products change often, so check the linked page before you rely on a detail. For apps that steer an agent from a phone, see Run Claude Code or Codex from your phone.

As documented by each product on 16 November 2026.
OptionWhere the agent runsLaptop can sleep?Local services and uncommitted workPhone accessCost
Keep the laptop awakeYour laptopNoYes, everything on the laptopThrough a remote tool, such as Remote Control or SSHFree; battery and heat
Always-on machine + tmux, SSH or moshYour desktop, home server or VPSYesOnly what is on that machine; push or copy work there firstPhone SSH or mosh appYour hardware or VPS bill; tmux, mosh and Tailscale Personal are free
Claude Code cloud sessionsAnthropic-managed VMYesNo local services. Clones your pushed GitHub branch, or uploads tracked files including uncommitted changesClaude app Code tab, claude.ai/codePro, Max, Ultra, Team, some Enterprise seats; shares your plan's usage limits
Claude Code Remote ControlYour computerNo; it reconnects after wakingYesClaude app, claude.ai/codePro, Max, Ultra, Team, Enterprise; API keys not supported
Codex cloudOpenAI's cloud, one workspace per taskYesWorks from repositories Codex can clone, such as GitHub or GitLab.comChatGPT appPlus $20/month, Pro from $100/month, Business, Edu, Enterprise; not with an API key
Codex remote connectionsYour Mac or Windows PC running the ChatGPT desktop appNoYesChatGPT appNeeds Codex access in your ChatGPT workspace
Bivy on your own machineYour Mac or Linux machineYes, if the agent runs on a machine other than the laptopYes, on that machineInstallable web app (PWA)Your own machines never count against a plan; self-host $0
Bivy cloud computerA persistent machine in Bivy's Fly.io accountYes; it sleeps when the work stopsNot your laptop's services. Moving a session carries committed state and a bounded uncommitted patchInstallable web app (PWA)Free: 5 hours once. Cloud: $15/month with 120 hours, then $0.10/hour

Keep the laptop awake

The simplest option, if you can leave the laptop plugged in where it is. The agent keeps your files, local services and logins. The cost is a laptop that can't go in a bag.

Run it on an always-on machine you own

The do-it-yourself option: a desktop, home server or VPS runs the agent, and you connect to it. It works with any terminal agent and adds no service in between.

Claude Code cloud sessions and Remote Control (Anthropic)

Cloud sessions keep Claude Code going after you close the laptop. Remote Control does not. They are easy to confuse, because both show up in the Claude app.

Codex cloud and Codex in ChatGPT (OpenAI)

Codex cloud runs tasks on OpenAI's side; remote connections steer a computer you own. Only the first keeps going while your laptop sleeps.

Bivy

Runs Claude Code, Codex and other agents on a machine you pick, and lets you follow and steer them from a phone, browser or terminal. The machine can be your own computer or server, or a Bivy cloud computer. Bivy runs the real agent CLIs, each with its own login and configuration.

Which should you pick?

FAQ

Does Claude Code keep running when I close my laptop?

Not if it runs on the laptop. Closing the lid normally puts the laptop to sleep, and a sleeping machine runs no processes. Claude Code's Remote Control reconnects when the laptop wakes, but no work happens while it sleeps. To keep going, keep the laptop awake, run Claude Code on a machine that stays on, or start a cloud session.

Can I keep a MacBook running with the lid closed?

Apple documents lid-closed use with an external display connected. OpenAI's Codex docs add that a Mac laptop with the lid closed needs both power and an external display to stay reachable. Without those, closing the lid puts the Mac to sleep.

How do I stop a Linux laptop from suspending when the lid closes?

Set HandleLidSwitch=ignore, or HandleLidSwitchExternalPower=ignore for plugged-in only, in a logind.conf drop-in. For one command, run it under systemd-inhibit with handle-lid-switch in --what. A plain sleep inhibitor is ignored on lid close by default.

Can I move a running local session to the cloud?

With Claude Code's CLI, no: handoff is one-way, from cloud to terminal with --teleport. The Claude Desktop app can send a local session to the cloud from its Open in menu. Bivy can fork or move a session from your laptop to another machine, including a Bivy cloud computer.

Do cloud sessions see my local database and uncommitted changes?

No local services. Claude Code cloud sessions clone your GitHub branch, so push first, or upload a bundle that includes uncommitted changes to tracked files but not untracked files. Codex cloud tasks work from repositories Codex can clone, such as GitHub or GitLab.com.

Sources

All checked on 16 November 2026.

Want to try Bivy? Start on a cloud computer with nothing installed, or connect your own Mac or Linux machine.

Start free on Bivy Cloud

Browse setup and security resources →