Build it live, then freeze it 🧊

Build it live, then freeze it 🧊

A tmux session often takes shape during live work: panes get repurposed, windows get regrouped, and commands get corrected, dropped, or kept.

tmuxp helps when that structure starts to settle. Instead of defining the session too early, build it in tmux first, then save the parts worth repeating.

tmuxp project

Official project: tmuxp/tmuxp

Early speculative YAML-first layout before pane roles and window grouping settled under live use

Practical workflow

1. Start a named tmux session

Create or attach to a named tmux session. The session name gives you a stable target to reattach, export, and reload.

Terminal zsh
$ tmux new-session -As sensors

sensors is just the example name in this walkthrough; the same flow works for any tmux session you want to preserve.

2. Shape the session under real use

Use the session and adjust it deliberately: keep the panes you actually use, resize for visibility, rename windows when useful, and repurpose panes as work evolves.

Live tmux session after iterative pane and window adjustments, at the point where layout is ready to be saved

3. Export the proven layout

Once layout and pane roles are stable enough, export the running session to a tmuxp workspace file.

Terminal zsh
$ tmuxp freeze sensors -o sensors.yaml

Frozen tmuxp workspace exported from the running session

Important

tmuxp freeze exports a reusable workspace definition from the live session and preserves the proven structural baseline for reload. It is not a full checkpoint of shell runtime or long-running process state, and exported commands can still include temporary live-session activity that needs cleanup.

A frozen export can have the right structure but still contain commands that are wrong for repeatable startup. Keep the pane/window structure and rewrite only replay behavior.

Workspace YAML after replay-policy cleanup with staged action panes and auto-running observer panes

In this updated sensors.yaml, replay policy is explicit:

  • enter: false is applied to action panes so commands are preloaded but require explicit confirmation.
  • The two watch panes stay auto-running because they are observer panes.
  • start_directory: /workspace keeps context stable, and focus: 'true' lands on a staged action pane.

The frozen YAML reflects whatever was active at freeze time. That is useful for structure, but often noisy for repeatable startup.

4. Optionally refine replay behavior

Refinement is optional. If reload behavior is already correct, the frozen file is enough.

When cleanup is needed, treat it as explicit authoring after export: keep the structure, then rewrite only replay behavior.

Verify before routine reuse

Before routine reuse, reload once from YAML and confirm behavior matches the file.

Terminal zsh
$ tmux has-session -t sensors 2>/dev/null && tmux kill-session -t sensors; tmuxp load ./sensors.yaml

Check that reload succeeds, pane structure matches the frozen layout, and command behavior matches your replay policy. If not, adjust the relevant YAML and rerun.

Session reloaded from the saved tmuxp workspace and ready for repeat use

Use tmux live until the layout proves itself, save it with tmuxp freeze 🧊, and refine YAML only where reuse still creates friction.