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.
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.
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!
Love it! I've been doing this manually when I need to restart my hosts :) Would it be possible to have instructions to install it that don't involve executing a script? Something as simple as the dependencies I need to install and the tmux config required would be super helpful.
I forked Zed to pass a ZED_TERMINAL_ID which is tied to the individual shell pane, using it to restore whatever agent session I had running in that pane. I keep 10+ Zed windows open with 1 to 4 agent panes, a reboot used to be a disaster.
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
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.
If there's anything sensisitve open on a tmux window somewhere it's just sitting in a file in your hard drive. It's overwritten every 10 minutes by whatever is there.
If that's a password for some reason, it could be captured.
I just thought it was going to be the sessions, window names, layouts. I wasn't expecting the content too. Not a big deal for me, but a surprise!
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)
I built an almost the same thing for myself and the main use case for me is on a work laptop where I run WSL and I leave on standby overnight. Then the I'd dept forces a reboot to install updates and all my windows are gone...
But the VM needs reboots too, kernel upgrades for example.
And if you upgrade libraries, especially for security issues, you need to restart apps dependent upon them, needrestart in Debian helps greatly with this.
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.
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.
Except... any running process?
> Windows / Dell / Security updates have me rebooting almost weekly - which means a restart of WSL
Oh the irony of WSL being a VM but not leveraging VM snapshotting capabilities.
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.
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!
Love it! I've been doing this manually when I need to restart my hosts :) Would it be possible to have instructions to install it that don't involve executing a script? Something as simple as the dependencies I need to install and the tmux config required would be super helpful.
I forked Zed to pass a ZED_TERMINAL_ID which is tied to the individual shell pane, using it to restore whatever agent session I had running in that pane. I keep 10+ Zed windows open with 1 to 4 agent panes, a reboot used to be a disaster.
Sure! I'll add this tomorrow :P
In order to try this, do I need to remove my current tmux-resurrect and tmux-continuum?
I’m pretty sure I’ve used tmux-ressurect for this. What’s the difference?
Hi! The main use case for me was to make sure agent sessions are also resumed and right where I left them :)
I have this exact use case, which resurrect doesn’t solve. I will try your plugin then, thanks!
You're welcome :) Let me know if you have any feedback
tmux might be getting a native save / restore feature for v4.0: https://github.com/tmux/tmux/issues/5693
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
I think herdr does this out of the box
Hadn't heard about herdr before! Downloading it now
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.
Happy to hear that it helped :)
What are the risks?
If there's anything sensisitve open on a tmux window somewhere it's just sitting in a file in your hard drive. It's overwritten every 10 minutes by whatever is there.
If that's a password for some reason, it could be captured.
I just thought it was going to be the sessions, window names, layouts. I wasn't expecting the content too. Not a big deal for me, but a surprise!
Ooh yeah. Very good point
This sounds great! Might convince me to defect from GNU screen.
Would highly recommend it myself ;)
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.
Does it restore active python venvs?
Not right now! I exclusively use uv these days which works in whatever directory you're in. Added to my todo list!
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)
I built an almost the same thing for myself and the main use case for me is on a work laptop where I run WSL and I leave on standby overnight. Then the I'd dept forces a reboot to install updates and all my windows are gone...
Saving state every afternoon would be a pain.
Move it to hyperv . Windows terminal integrates as cleanly as wsl . Hyperv gives you hibernation by default
Might be a bit naïve, but wouldn't a VM take up a lot more memory?
You can get the overhead down to 85mb, about an empty browser tab
But the VM needs reboots too, kernel upgrades for example.
And if you upgrade libraries, especially for security issues, you need to restart apps dependent upon them, needrestart in Debian helps greatly with this.
So a VM doesn't really help solve this.
You’re always making tradeoffs. For 100 sessions , which one works better ? Would you use the worse setup for the once a month you need to reboot ?
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.
Yup, that was exactly my pain point too!