Save and restore tmux pane layouts per directory.
Source the script in your shell config:
source /path/to/tmsave.shDependency: jq (for JSON parsing on restore)
cd ~/myproject
# Set up your panes how you like them
tmsavecd ~/myproject
tmrePass a directory to load its layout and apply it to your current directory. Subdirectory panes are mapped relatively.
# You have a layout saved for your main worktree
cd ~/myproject-feature-branch
tmre ~/myproject
# Pane that was at ~/myproject/ui → opens at ~/myproject-feature-branch/uitmlist # Human-readable table
tmlist --json # JSON array for scriptingWhen you relocate a project:
tmsavemv ~/old/path ~/new/pathAll commands support -h / --help:
tmsave --help
tmre --help
tmlist --help
tmsavemv --help- Layouts are stored in
~/.local/share/tmsave/layouts/ - Indexed by base64-encoded directory path
- Saves: pane geometry, subdirectory paths, active pane
- Restores: recreates panes, applies layout,
cds into subdirectories only where needed
- Run
tmsavefrom the project root directory - Panes in subdirectories are restored with relative
cd - Panes outside the base directory stay at the base on restore (warning shown on save)