A field guide to keeping Claude Code sessions alive when your laptop keeps cutting out — and the one truth about tmux nobody tells you.
tmux keeps sessions alive when your terminal dies — you close the window, SSH drops, the app crashes. But the tmux server is just another process on the machine. When the laptop loses power, that process dies with everything else.
The whole OS goes down — and tmux goes with it. To actually survive power loss you need two things working together: Claude's own session recovery, and (ideally) running the work somewhere that isn't on the failing cord.
Claude Code writes conversation history to disk continuously. After any crash or reboot, the in-flight tool call is lost — but the conversation is recoverable. This is your real power-loss safety net.
# reopen the most recent session in this directory $ claude --continue # pick from a list of past sessions $ claude --resume
Test it now: start a session, say something, hard-kill the terminal, then run claude --continue. Watching it come back builds the muscle memory you'll want at 2am.
The bulletproof setup: run claude inside tmux on an always-on machine — Pluto or the macmini — and SSH in from the laptop. Now the laptop dying is a non-event. You just SSH back and reattach.
$ ssh youruser@<box> # from the laptop $ tmux attach || tmux new -s claude # ... laptop loses power ... $ ssh youruser@<box> # reconnect $ tmux attach -t claude # still running the whole time
Everything is prefix then key. Default prefix is Ctrl + b — press both, release, then tap the next key.
$ tmux new -s claude # start a named session $ tmux ls # list running sessions $ tmux attach -t claude # reattach (or just: tmux a) $ tmux kill-session -t claude
For the laptop itself, lean on claude --continue — that's what survives power loss. For real resilience, move long-running work onto Pluto or the macmini over SSH + tmux, so the flaky cord stops mattering at all.