How to keep remote SSH sessions alive when moving between networks?

My workflow is local installation of Antigravity IDE connecting to remote machines via SSH.

Every time my connection blips or I close my laptop to move, the Antigravity SSH session snaps. My session is gone, and I have to restart the prompt. I also have quick disconnects which lead to the same thing.

I’m looking for a way to make the session “indestructible” so I can go offline, move, and have the IDE snap back to life exactly where I left off. And ideally it finished what it started solving before I left.

The only thing in this direction that worked is explicitly ask the agent to run each single command inside of a tmux session, so at least short benchmarks or proof of concepts I am asking it to run, do not disappear.

Is there a more stable approach to this?