Keep a coding agent running when your laptop goes to sleep

· 3 min read · By the Sidefleet team

A coding agent stops when the laptop it runs on goes to sleep. You can keep the laptop awake, run the agent on a machine that never sleeps, or let the task move. With Move if it drops on, Sidefleet pushes the task's branch as the agent works, and another machine with the repo carries on from the last pushed commit.

What happens to an agent when the laptop sleeps?

Sleep suspends every process, the agent included, and drops the network. Nothing runs until the lid opens. A long refactor you left at 6pm is where you left it the next morning.

Under Sidefleet, the machine stops checking in with the control plane. Without Move if it drops, the task stops with the machine and the bell lists it as "machine dropped", so you know to pick it up.

What are your options?

Three ways to keep work going when the laptop closes.
OptionSetupTrade-off
Keep the laptop awakeOne commandThe laptop has to stay open and powered
Run agents on an always-on machineConnect a Mac mini or VPS onceA second machine to keep
Move if it dropsA switch per taskPushes the task's branch to origin as it works

How do you keep a Mac awake while an agent runs?

macOS ships caffeinate. Run it in a terminal and the Mac won't idle-sleep until you stop it with Ctrl-C:

caffeinate -i

It doesn't help when you close the lid on battery, and it ties the work to that one laptop staying on.

Why run agents on a machine that stays on?

Connect a desktop, a Mac mini or a VPS as a worker, and the laptop becomes the place you type tasks rather than where they run. Closing it changes nothing. It's the option we'd pick. The steps are in running Claude Code on multiple machines. You install, run sidefleet connect, and a launchd or systemd service keeps the worker running across reboots.

How does Move if it drops work?

  1. Turn on Move if it drops in the composer's options. It is offered for tasks on their own branch, not In place ones.
  2. While the agent edits, the worker commits and pushes the task's sidefleet/<id> branch to the repo's origin, at most once a minute.
  3. If the machine stops responding, say a laptop going to sleep, the control plane moves the task to another machine that has the repo and the agent.
  4. That machine continues from the last pushed commit, and its agent gets a digest of the thread so far.

It is off by default because it pushes. Only the task's own sidefleet/... branch is ever pushed, never main or your own branches.

What can a moved task lose?

  • Edits since the last push, up to about a minute's worth.
  • The agent's session. The new machine starts a fresh session with a digest of the thread, not the first agent's full context.

Ask for progress that lives in the files, such as a checklist in a notes file the agent updates, and the second agent picks up faster.

What does Move if it drops need?

  • An origin remote that both machines can push to and fetch from.
  • Another online machine with a checkout of the repo and the same agent, signed in.
  • A task in its own worktree. See git worktrees for parallel agents.

Questions

Will I know when a task moved?

Yes. The task's thread records it, and if the task ends up waiting for you, the bell and Notify me tell you.

Does it work without Move if it drops?

The task stops with the machine. Reply when the laptop is back, or fork the thread onto another machine.

Does it push to my main branch?

Never. Only the task's own sidefleet/... branch.

Put your machines to work

Sign in with GitHub and connect a machine. Free for 2 machines, and the agents and your repos stay on your machines.