Session persistence for cmux β your terminal workspaces, resurrected.
cmux is a popular terminal multiplexer in the Ghostty ecosystem (14K+ stars). It handles session restoration well most of the time, but crashes, forced updates, and unexpected reboots can still wipe your workspace. crex (short for cmux-resurrect) is a safety net for those moments.
β‘οΈ One command saves your entire cmux layout. One command brings it back β workspaces, splits, CWDs, pinned state, startup commands, everything.
Inspired by tmux-resurrect (12.7K stars) β crex does for cmux what tmux-resurrect does for tmux, and takes it further with Workspace Blueprints: define your ideal terminal setup in a Markdown file (Obsidian-compatible), version it, share it with your team, and let crex build it for you.
brew install drolosoft/tap/cmux-resurrectBoth crex and cmux-resurrect are ready to use, with shell completions installed automatically. No Go toolchain required. macOS only (cmux is a macOS terminal).
go install github.com/drolosoft/cmux-resurrect/cmd/crex@latestFor building from source, see docs/building.md.
Homebrew users get completions automatically. For manual installs, add one line to your shell config:
eval "$(crex completion zsh)" # zsh β add to ~/.zshrc
eval "$(crex completion bash)" # bash β add to ~/.bashrc
crex completion fish | source # fish β run onceNow crex <TAB> shows all commands, crex restore <TAB> completes your saved layout names, and flags like --mode complete their values. See docs/shell-completion.md for the full guide.
crex save my-day # snapshot your current layout
crex save my-day --dry-run # or preview first without savingcrex save my-day # snapshot your layout
crex restore my-day # bring it all backEvery workspace, split, CWD, pinned state, and startup command β captured and restored. Layouts are saved to ~/.config/crex/layouts/.
Define your workspaces in Obsidian-compatible Markdown. Import creates only what's missing β it's idempotent.
## Projects
**Icon | Name | Template | Pin | Path**
- [x] | π | webapp | dev | yes | ~/projects/webapp
- [x] | βοΈ | api | dev | yes | ~/projects/api-server
- [x] | π§ͺ | tests | go | yes | ~/projects/testing
## Templates
### dev
- [x] main terminal (focused)
- [x] split right: `npm run dev`
- [x] split right: `lazygit`crex import-from-md # create workspaces from Blueprint
crex export-to-md # capture live state to BlueprintFor the full Blueprint format, templates, and CLI management, see docs/blueprint.md.
tmux-resurrect proved that session persistence is essential for any serious terminal multiplexer workflow. Every multiplexer eventually gets one β crex is that tool for cmux.
| tmux-resurrect | crex | |
|---|---|---|
| π | Plugin configuration | Workspace Blueprint β Markdown files, Obsidian-compatible |
| π§© | Manual pane recreation | Reusable templates (dev, go, monitor) |
| π₯ | One-way restore | Bidirectional β import from and export to Markdown |
| ποΈ | Execute immediately | Dry-run mode β preview every command first |
| β±οΈ | Manual saves | Auto-save with launchd β deduped, zero-maintenance |
| π | Edit config files | CLI workspace management β add, remove, toggle from terminal |
| π€ | Basic tab completion | Dynamic completions β layout names, workspace names, flag values (bash/zsh/fish) |
| Doc | Description |
|---|---|
| Commands | Full command reference, flags, and recipes |
| Workspace Blueprints | Blueprint format, templates, CLI management |
| Workflows | Save/Restore vs Import, dry-run, side-by-side comparison |
| Configuration | config.toml reference and defaults |
| Auto-Save | launchd integration for macOS |
| Shell Completion | Setup, troubleshooting, what gets completed |
| Building from Source | Makefile targets, cross-compilation, platform support |
| Architecture | Internal design for contributors |
Contributions are welcome β bug fixes, new templates, feature ideas. Open an issue or submit a PR.
If crex saves your sessions, consider giving it a β on GitHub β it helps others discover the project.
If crex saved you time or made your workflow easier, consider buying me a coffee β it keeps the next one coming!
MIT License β free to use, modify, and distribute.
Born from a real need: a crashed cmux session took an hour of carefully arranged workspaces with it. crex exists so that never happens again.
Forged by Drolosoft Β· Tools we wish existed




