Skip to content

Long-running tasks

Use tmux so nothing stops when you disconnect

Section titled “Use tmux so nothing stops when you disconnect”
Terminal window
tmux new -s work # start a session
claude # run Claude Code inside it
# Ctrl-b then d: detach, the task keeps running
tmux attach -t work # pick up where you left off

Dropping SSH or closing your laptop doesn’t affect processes inside tmux.

New machines do not auto-suspend by default — they stay up, so long tasks aren’t interrupted.

If you turned auto-suspend on, a machine only suspends after 20 minutes (configurable) of all of these at once: no connections, a nearly idle CPU and almost no network traffic. Claude Code has connections and traffic while it talks to the model, so it isn’t treated as idle.

Suspending doesn’t kill processes: memory is saved to the encrypted disk and loaded back exactly on the next connection.

With auto-suspend on, to make sure the machine doesn’t sleep for a stretch:

Terminal window
hangar keep-awake 4h # up to 24 hours, reverts automatically
hangar keep-awake off # cancel early