← All posts

Stop Losing Your Build to a Sleeping Laptop: Run AI Tasks on an Always-On Box

August 21, 2026 · 4 min read · The xShellz Team

TL;DR

  • You can run AI coding tasks on an always-on xshellz.box that stays up even when your laptop sleeps, using a single SSH command and tmux.
  • Every xshellz.box includes tmux, six preinstalled AI coding agents like borg, and persistent /root storage, with no idle timeout on any tier including free.
  • Offload heavy builds, long refactors, or data scraping to a remote shell with a tmux new-session -s agent command and never lose a session to a dropped connection.

To run a long AI coding task without your laptop sleeping and killing the process, offload it to an xshellz.box. This always-on Linux sandbox keeps running 24/7 with zero idle timeout, even on the free plan. Start your task inside a tmux session over SSH, close your laptop lid, and the job continues on the remote box. We run the xShellz fleet ourselves, so this guide reflects the exact setup our own engineers use for production work.

how can i run a long AI coding task without my laptop sleeping and killing the process?

Move the work to an xshellz.box. Connect via SSH to a box that stays online no matter what your local machine does. Each box is a hardened Ubuntu 24.04 sandbox with real root inside a userns-remap container (backed by a gVisor sandbox, not a raw VPS). Once logged in, wrap your AI agent command inside tmux, detach, and the task runs indefinitely. The box keeps running 24/7 on every tier, free included, so even if your laptop crashes or you close the lid, the process never stops.

ssh -p <port> root@<host>
# once inside:
tmux new -s build borg "fix the failing test"
# detach with Ctrl+B, then D

how do i run a background task on a remote linux box that stays alive?

tmux solves this completely. On any always-on xshellz.box, SSH in, create a named tmux session, and launch your long‑running command. Detach with Ctrl+B D and your session lives on the box. Reattach later with tmux attach -t <name>. Because the box itself never sleeps, the tmux session persists through laptop sleep, Wi‑Fi drops, and terminal closures. tmux is preinstalled on every box alongside other tools like htop and build-essential, so there is nothing to install.

can i move my heavy ai coding agent jobs to a cloud sandbox?

Yes. The xshellz.box is purpose‑built for running AI coding agents around the clock. Six agent CLIs come preinstalled: borg, Claude Code, OpenAI Codex, Gemini CLI, opencode and pi. The environment ships with Node 22, Python 3, git, ripgrep and build‑essential, so any coding agent has a full development stack from the first login. The sandbox uses Linux user namespaces for fake‑root and a gVisor kernel for isolation, giving you a safe place to let an agent touch files, run builds, or refactor entire repos without affecting your local machine.

how to use tmux with an ai agent to prevent disconnected sessions

Create a dedicated tmux session for your agent, start the agent, and detach. When you come back, reattach exactly where you left off. On an xshellz.box, you can even start the session detached in one step and collect the output later.

# Start a detached borg session that rewrites a test suite
tmux new -d -s silent borg "rewrite the test suite"
# later, reattach to see progress
tmux attach -t silent

List all running sessions with tmux ls. Kill a finished one with tmux kill-session -t silent. Because /root is persistent, any files the agent generates survive a box rebuild, so your work is safe even when the underlying image updates.

is it better to run long builds on a local machine or a remote shell?

A remote shell wins for any task that outlasts your coffee break. laptop sleep, OS updates, and spotty Wi‑Fi can kill a local build instantly. A remote xshellz.box has no idle timeout and runs 24/7, so a 30‑minute Docker build, a two‑hour dataset scrape, or an overnight AI refactor always finishes. The persistent /root home directory means compiled artifacts and agent output are still there after a reboot or image update. You also avoid the local‑machine cost of dedicating CPU and memory to a background agent while you do other work.

Frequently asked questions

What happens to my files if the box gets rebuilt?

The /root directory is persistent and survives every image update. Any packages listed in your xshellz.box manifest are reinstalled automatically on boot, so your custom environment comes back exactly as you left it.

Do I need to install tmux or any AI agents on the box?

No. Every xshellz.box comes preinstalled with tmux, borg, Claude Code, Codex, Gemini CLI, opencode, pi, and a full build toolchain. You can start a background agent session immediately after your first SSH login.

How much does an always‑on box cost?

There is a free tier that includes an always‑on box with no idle timeout and no trial countdown. Paid plans add more CPU, memory, and storage. See the full pricing page for current details.