you@host:~$ tmux attach -t claude

Surviving the
Power Cord.

A field guide to keeping Claude Code sessions alive when your laptop keeps cutting out — and the one truth about tmux nobody tells you.

host your-box tmux 3.6 claude 2.1.149
read this first

tmux does not survive a power-off

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 trap

If the cord cuts out, plain tmux on the laptop saves nothing.

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.

layer one

01claude --continue / --resume

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.

recover after a crash
# 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.

layer two

02Run it on a box that won't die

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.

the resilient loop
$ 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
cheat sheet

tmux, the parts you'll actually use

Everything is prefix then key. Default prefix is Ctrl + b — press both, release, then tap the next key.

sessions — the part you care about
$ 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
Detach — leave it running
Ctrl+bthend
New window
Ctrl+bthenc
Next / previous window
Ctrl+bthenn/p
Split vertical / horizontal
Ctrl+bthen%/"
Move between panes
Ctrl+bthen←↑↓→
Scroll / copy mode  (q to exit)
Ctrl+bthen[
the daily loop

How a session actually goes

  1. tmux new -s claude — open your named session.
  2. claude — run it as normal inside the session.
  3. Walk away, close the lid, terminal crashes — the session keeps running as long as the machine stays on.
  4. tmux attach -t claude — pick up exactly where you left off.
  5. Machine actually powered off? Fall back to claude --continue.
▌ the verdict

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.