Keep Claude Code running with your laptop closed
Why closing the lid stops Claude Code, the ways to keep it working, and how to run it on a box that stays on while your laptop sleeps, with what it costs.
On this page6
A sleeping laptop runs nothing, so closing the lid stops Claude Code mid-task. Over SSH, the lid drops the connection, and Claude Code ends with it unless it runs inside tmux. To keep working, it needs a persistent session on a machine that stays on:
- tmux on a server you run. You maintain the machine and move your code there with git.
- Claude Code cloud sessions (
claude --cloud, on Claude Pro, Max and Team, and Enterprise seats with Claude Code). A VM that Anthropic runs clones your GitHub repository at the pushed branch (Anthropic's docs). - A Prized box. A Linux machine that stays on, with your project folder synced both ways and its ports on your localhost. The steps follow.
1. Put your project on a box
cd ~/code/myproject
npx prizedIt signs you up (GitHub or Google), starts a box on $30 of free credit with no card, and syncs this folder with ~/code/myproject on the box. Pick Terminal, then Claude Code: after asking, it copies your Claude Code sign-in to the box and starts Claude Code there, in a tmux session named claude (Sign up from your terminal). Already signed in on this machine? Run prized setup in the folder instead.
2. Close the lid
Give Claude Code its task, then close the terminal or the laptop. The session belongs to the box, so Claude Code keeps working, and its edits sync to your laptop when it wakes (Sync). If the session is gone, this starts it again:
prized agents run claude --attach --dir code/myproject3. Check on it from anywhere
- From a computer:
prized ssh -s claude. On another computer, install the CLI and runprized loginfirst. - From your phone or any browser: open the box on the dashboard. The arrow beside Open terminal lists Claude Code, which opens the box's terminal in the
claudesession.
4. Get notified
Type /remote-control in the session to follow it from the Claude app, then turn on push notifications in /config; this needs a Claude subscription sign-in, not an API key (Anthropic's docs). On your computer, agents you run in herdr post a notification when they finish or need you.
Or hand it a task and walk away
prized prompt --provider claude --cwd code/myproject --auto --detach "run the test suite and fix what fails"This runs Claude Code headless on the box and returns at once; prized events --follow follows the run. --auto lets it run commands without asking (Prompt an agent remotely).
What it costs
| Small (4 vCPU, 16 GB) | Nano (2 vCPU, 2 GB) | |
|---|---|---|
| Awake, per hour | $0.137 | $0.014 |
| A 10 hour run overnight | $1.37 | $0.14 |
| How long $30 of free credit lasts, awake around the clock | About nine days | About three months |
Asleep, a box pays only for its disk (Billing). On the free credit, a box sleeps after 2 hours idle, never in its first 24 hours; a working agent counts as use, so the box stays up while Claude Code works (Auto-pause). A Small keeps Claude Code's session through a pause, and prized box pause sleeps it at once (Pause and resume).