Hivra
Free tool. No signup.

Will your agent survive the night?

Answer a few questions about your setup. Find out whether Claude Code keeps working when you close the lid, and what to fix if it doesn't.

Claude Code runs on your machine. Close the lid and the OS suspends it mid task. Nothing runs while the lid is shut, and a long tool call or network request often fails when the machine wakes. The same goes for Codex and most CLI agents.

Tell the check where the agent runs and how the session stays alive, then what happens on sleep, network drops and reboots. For some setups, tmux on a VPS is enough, and the result says so.

Where does the agent run?
How does the session stay alive?
Laptop sleep behavior
Do you reach it over SSH?
What restarts it after a crash?
Reboots and updates on that machine
RAM where the agent runs
Network where the agent runs
How do you check on it remotely?
Survival score26 / 100

Does not survive tonight

How this setup dies, worst first

1. Lid close suspends the machine

-35 pts

You close the lid at 11pm. The OS suspends every process mid tool call, network sockets die, and the run makes no progress until morning. There is no error to tell you.

Free fix: keep the machine awake while the agent runs. On macOS, caffeinate blocks sleep while it runs, full system sleep only on AC power, and closing a MacBook lid still sleeps it unless you set up closed-display mode with an external display. On Linux, set HandleLidSwitch=ignore in /etc/systemd/logind.conf. Honest tradeoff: battery drain, heat, and a laptop you cannot close or carry.

caffeinate -dimsu

2. A crash is permanent

-15 pts

The agent hits an unhandled error at 2am and exits. Nothing notices and nothing restarts it. The server is fine; the process is just gone.

Free fix: a systemd unit that starts the agent in a detached tmux session and restarts it on failure. Replace User=you with your username, then run: sudo systemctl enable --now agent. Honest tradeoff: it restarts a fresh session, not your conversation. Whatever context the run had is gone.

# /etc/systemd/system/agent.service
[Unit]
Description=Agent tmux session
After=network-online.target

[Service]
Type=forking
User=you
ExecStart=/usr/bin/tmux new-session -d -s agent claude
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

3. Reboot comes back empty

-10 pts

unattended-upgrades reboots the server at 4am for a kernel patch. The machine comes back up clean. The agent does not, because nothing starts it at boot.

Free fix: the same systemd unit covers this. WantedBy=multi-user.target makes it start at boot, so a reboot brings the agent back on its own.

sudo systemctl enable agent.service

4. Failures go unnoticed for hours

-8 pts

The run died at midnight. You find out at 9am. The failure cost you the whole night, not the ten minutes the fix would have taken.

Free fix: an SSH client on your phone plus tmux attach lets you check and restart from anywhere. Honest tradeoff: a phone terminal is a rough place to read diffs.

tmux attach -t agent

5. Wifi drops cost you runs

-6 pts

The wifi drops for two minutes mid tool call. The API request times out, and if you were attached over SSH, that session went down with it.

Free fix: plug into ethernet, or move the run onto a machine with a wired or datacenter connection. Honest answer: there is no config flag that fixes a bad link. tmux limits the damage to the one interrupted call.

What this costs you:interruptions a week xminutes to restore at $an hour is about $170 a week of your time.

Shareable verdict
Agent Survival Check: 26/100 (Does not survive tonight)
Top failure modes:
1. Lid close suspends the machine
2. A crash is permanent
3. Reboot comes back empty
https://hivra.cloud/tools/agent-survival-check

Assumptions: severities and interruption counts are rough estimates from common failure reports, not measurements of your machine. The free fixes are real and often enough; a VPS with tmux and a systemd unit is a fine setup if you want to run it. Commands and defaults last checked September 2026 against the macOS, OpenSSH, tmux, systemd and util-linux manuals.

A managed always-on computer takes the lid and the server upkeep off your list. Hivra runs Claude Code on a cloud computer with your own sign-in, and that computer stays on with your files, sessions and login. Start a run inside tmux in its Terminal tab, or send it from Telegram, and it keeps going after you close the laptop. The $9.99 a month plan gives it 2 vCPU and 4 GB, and paid plans are not paused for inactivity.

Skip the server upkeep

Common questions

Why does Claude Code stop when I close my laptop?

Sleep suspends every process on the machine, including your terminal and the agent inside it. On wake, network connections may have dropped and long running tool calls may have timed out. If the agent ran over SSH, the disconnect usually kills the remote session too unless it was inside tmux or screen.

Does tmux keep Claude Code running?

On an always-on machine, yes. tmux detaches the session from your terminal, so closing the SSH connection doesn't kill the agent. It does nothing for a laptop that goes to sleep, because the whole machine suspends, tmux included.

Can I just stop my laptop from sleeping?

Partly. On macOS, caffeinate blocks sleep while it runs. It blocks full system sleep only on AC power, and closing a MacBook lid still sleeps it unless you've set up closed-display mode with an external display. On Linux you can tell logind to ignore the lid. You pay in battery, heat and a machine you can't close or carry. Reboots, updates and network changes still kill the run.

How do I keep an AI agent running overnight?

Run it on a machine that stays on. That can be a desktop you leave running, a VPS with tmux, or a managed computer. Hivra runs Claude Code on a cloud computer with your own Anthropic sign-in. The $9.99 a month plan gives it 2 vCPU and 4 GB, and paid plans aren't paused for inactivity. Start the run inside tmux in the computer's Terminal tab, or send it from Telegram, and it keeps going with your laptop closed.

Is a VPS with tmux enough?

Often yes. A $5 VPS plus tmux keeps the process alive around the clock. You handle the install, the updates and the restart when something crashes. Checking in from a phone means SSH. Managed hosting is the same idea with the ops handled, plus a chat and a web terminal in the browser.

Put your agent on a computer that stays on.

From $9.99/mo for 2 vCPU and 4 GB, not paused for inactivity. Your own Claude or ChatGPT login, or your own AI key. 7-day money-back guarantee on card payments.

Hivra is independent and is not affiliated with Anthropic or OpenAI.