logoalt Hacker News

Show HN: Tmux-restore saves tmux windows and agent sessions across reboots

48 points • by boldi • last Tuesday at 5:25 PM • 32 comments • view on HN

Comments

ghshephard • today at 8:42 AM

This is built on top of tmux-continuum & tmux-resurrect, tmux plugins which I've been using now for 10+ years - pretty much every day - they bring so much joy to using tmux.

Zero worries about having to restore local window settings - It's not uncommon for me to have 40+ panes split across 15+ windows. Windows / Dell / Security updates have me rebooting almost weekly - which means a restart of WSL - but, with continuum/ressurect - zero issues - all the windows, panes, scrollback (!) and with just a tiny bit of bash history foo - command history - are completely restored as though nothing had changed.

Really interested to see if restore lives up the foundations that it's built on.

➕ show 1 reply
Roark66 • today at 12:01 PM

I've made a very similar tool github.com/lukolszewski/session-keeper

But my tool supports pi, claude code and copilot cli as this is what I use. It also saves any tail -f and few other processes I tend to leave running for a long time as well as folders I'm in.

My tool is likewise built on top of the same tmux plugins so it saves windows layouts, names etc.

After I started using it, especially on a Windows work laptop (in WSL) that has a habit of restarting almost every night to "do updates" I don't know how could I ever live without it.

But my tool saves every few min on a schedule as well as on keystroke. I didn't need save on shutdown, because my main use case is protecting from unexpected restarts such as a mashine crash or those updates pushed by corporate it every night.

It is very cool creating such tools has become so easy one can just casually do it without spending days of time on it. That's a great benefit of AI.

Another tool I find indispensable for pi, although it's still a work in progress is my tool use permission/classified called adaptive-acl (same github account). It has a very elaborate treesitter based deterministic classification layer plus an llm feature that extracts the intent from the user context and converts it into deterministic rules.

So there is no llm call on every tool use, just those tgat don't match the deterministic rules.

My favourite feature is good level of control on the grants, ability to preview them, alter them, export, import. I also have a bajillion of my private session records that I tend to test any prompt/classifier changes so I don't get unexpected regressions.

I tend to use opus 5.5 supervisor and a team of 7 DeepSeek v4.1 Flash 1017 agents to write it (used to be Qwen3.8-Flash-Next). It does a great job, but it needs substantial architecture hand holding.

boldi • last Tuesday at 7:45 PM

Hi everyone I built this since it'd be so frustrating to have all my tmux windows with different paths and layouts all destroyed when restarting my computer (e.g. for installing drivers). It also resumes e.g. claude code sessions. Hope it helps!

➕ show 1 reply
hxugufjfjf • today at 4:36 AM

I’m pretty sure I’ve used tmux-ressurect for this. What’s the difference?

➕ show 1 reply
atomicstack • today at 12:36 PM

tmux might be getting a native save / restore feature for v4.0: https://github.com/tmux/tmux/issues/5693

Octetmed • today at 10:45 AM

I’ve been using this for a while, tmux resurrect by itself I had been using for forever but since Claude code came out it’s been frustrating to not have those long sessions restored in their right panes and this makes it soo much better. You restore and everything is in its place

gb2d_hn • today at 8:40 AM

I think herdr does this out of the box

➕ show 1 reply
jauntywundrkind • today at 3:40 AM

After much delay I finally got tmux-continuum & tmux-resurrect going. Which I think are very well known plugins for this.

https://github.com/tmux-plugins/tmux-continuum https://github.com/tmux-plugins/tmux-resurrect

Also used tpm, the plugin manager. There's some variants. I went with ahiru-tpm which is pretty drop in compatible but not seeing much action, and tpm seems more active again. https://github.com/tmux-plugins/tpm https://github.com/x3rAx/ahiru-tpm

One of the weird cool (but also, wish I'd known, has risks!) things I wasn't expecting is that captures the screen buffer. The program is dead, but there it is, whatever was last there, when you reboot. Wild.

I've had some system instability some, alas (blast you ram crunch), and did everything under the sun to build tools to capture my workspace. This, this was way way easier.

➕ show 2 replies
TeaVMFan • today at 3:05 AM

This sounds great! Might convince me to defect from GNU screen.

➕ show 1 reply
_blk • today at 6:14 AM

Cool thanks, will give it a shot.

Does anyone know how this compares to herdr? I've been curious to try that I've too.

peterdemin • today at 3:20 AM

Does it restore active python venvs?

➕ show 1 reply
tonymet • today at 7:25 AM

This is clever, but running in a VM with hibernation is a lot easier, more consistent and more comprehensive (all state is saved, and restored instantly)

➕ show 2 replies
enoch_hou • today at 3:51 AM

This is exactly the pain point for me — losing a whole tmux layout after a reboot is annoying, but losing the agent sessions running in those windows is worse. tmux-resurrect never quite got the agent part right for me, so I'm curious to try this and see how it handles restoring those sessions.

➕ show 1 reply