by fazxes
Keep the programs in your Rex tabs across server restarts and reboots. fx, Claude Code, and Codex chats reopen on their own conversation.
# Add to your Claude Code skills
git clone https://github.com/fazxes/rex-durableGuides for using cli tools skills like rex-durable.
See how rex-durable compares with popular alternatives.
rex-durable is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by fazxes. Keep the programs in your Rex tabs across server restarts and reboots. fx, Claude Code, and Codex chats reopen on their own conversation. It has 56 GitHub stars.
rex-durable's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/fazxes/rex-durable" and add it to your Claude Code skills directory (see the Installation section above).
rex-durable is primarily written in Lua. It is open-source under fazxes on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh rex-durable against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Keep the programs in your Rex tabs across server restarts and reboots.
Rex saves your sessions, tabs, and splits when its server stops, and restores them when it starts again. The programs that were running in them don't come back: every tab returns as an empty shell. rex-durable remembers what was running in each tab and puts it back.
| Running in the tab | After a restart |
|---|---|
| fx chat | Reopens on its conversation: fx --resume <id> |
| Claude Code chat | Reopens on its conversation: claude --resume <id> |
| Codex chat | Reopens on its conversation: codex resume <id> |
| Any other program | Typed at the prompt, not run. Press Enter if you want it. |
| Plain shell | Left alone |
Chats keep their options, such as --model, and come back in the same tab, split, and folder.
git clone https://github.com/fazxes/rex-durable
cd rex-durable
./install.sh --add-to-config
The installer:
rex command. On macOS it uses the copy Rex keeps up to date in ~/Library/Application Support/com.superlogical.rex/RexServer/Versions/Current/, so Rex updates don't break it.durable.lua to ~/Library/Application Support/rex-durable/ on macOS, or ~/.local/share/rex-durable/ on Linux.rex_durable.lua in your Rex config folder). --add-to-config also loads them from init.lua for you. Without it, the installer prints the one line to add.Run ./install.sh again to update. Use --no-service to install the files without the service, or REX=/path/to/rex ./install.sh to choose the rex command.
Requirements: Rex for Mac, or the Rex server on Linux, recent enough to have the Lua API's rex.exec, rex.json, rex.every, and rex.on. The installer checks this. You also need lsof, or /proc on Linux.
There's nothing to do day to day. Every 30 seconds, and a few seconds after any change, rex-durable saves what runs in each tab. After a restart, it brings everything back within seconds and shows a notification such as "Reopened 12 chats."
To check on it, or to do something by hand:
S="$HOME/Library/Application Support/rex-durable/durable.lua" # Linux: ~/.local/share/rex-durable/durable.lua
rex do "$S" mode=status # what is saved, and the last restore
rex do "$S" mode=save # save now
rex do "$S" mode=reopen dry_run=true # show what a reopen would type
rex do "$S" mode=reopen # reopen programs in their tabs
rex do "$S" mode=checkpoint name=before-update
rex do "$S" mode=reopen from=before-update # reopen from a pinned checkpoint
rex do "$S" mode=rebuild from=before-update yes=true # recreate saved sessions
The command palette has the same actions: search for "durable".
Add programs=false to any mode to reopen chats only, and never type other programs' commands.
durable.lua is a Rex Lua script. The service runs it with rex do durable.lua --all, which hears events from every session. It uses only Rex's public API:
Watching. On a timer (rex.every) and after layout and terminal events (rex.on), it starts a short rex do durable.lua mode=save. Each save runs on its own connection, so reading every session never affects the watcher.
Saving. For each tab, it records the block ID, the folder, and the program from the terminal's process method. It then works out which conversation each chat is on:
~/.fx/sessions/v2/<id>/lock).~/.codex/sessions/…/rollout-…-<id>.jsonl), or the ID is on its command line (codex resume <id>).--resume <id>). Otherwise rex-durable uses the newest session file for that folder written since the chat started. If two such chats share a folder, it can't tell them apart, so they come back typed, not run.Saves go to ~/Library/Application Support/rex-durable/ on macOS, or ~/.local/state/rex-durable/ on Linux. It keeps the last save of each of the latest 10 servers.
Restoring. When the watcher connects to a server instance it hasn't seen, it takes the last save from the previous server. Rex restores its own sessions with the same block IDs, so each program goes back into exactly the tab it came from, by block ID first and then by session name and position. If the server starts empty, for example after rex server stop --discard, rex-durable creates the saved sessions itself.
dry_run=true shows what a reopen would type, without typing it.HOME, such as a test profile, comes back typed, not run../uninstall.sh # stop the service and remove the files, keep your saves
./uninstall.sh --purge # remove the saves too
Your Rex sessions and the programs in them are not touched. If you added require("rex_durable") to init.lua, remove that line too.
test/e2e.sh # unit tests, then end-to-end tests on a throwaway Rex server
test/e2e.sh --unit # unit tests only
lua5.1 test/platform.lua # process and file helpers on Linux, without Rex
The end-to-end test needs Rex and a C compiler. It runs its own Rex server on its own socket, with fake fx, Claude Code, and Codex chats in a throwaway home folder. It never connects to your Rex server and never touches your real chats.
rex-durable is not made by or affiliated with Superlogical.