Skip to content

Tmux Setup

Tmux gives every agent a permanent, addressable pane. When an agent finishes, back2vibing restores focus to that exact pane — the right session, the right window, the right pane. No hunting through tabs.

Persistent sessions

Your agents keep running even if your terminal window closes or your SSH connection drops. Reconnect and everything is exactly where you left it.

Automatic focus restoration

Back2vibing tracks which tmux pane each agent runs in. When an agent finishes, focus snaps to that pane automatically.

Parallel agents

Split panes let you run multiple agents side by side. Switch between project sessions instantly.

Zero overhead at scale

One agent is manageable without tmux. Three agents across two projects is chaos — unless your tools handle the routing.

The fastest way to set up tmux for back2vibing is to use our recommended dotfiles. This will automatically install tmux, sesh, and all necessary configurations for macOS or Linux.

Terminal window
# Clone and run the interactive setup
git clone https://github.com/builtby-win/dotfiles.git ~/dotfiles
cd ~/dotfiles
./setup.sh

The setup script will walk you through installing everything you need, including terminal themes and shell integrations.

Standard tmux uses Ctrl+b as the prefix (the “Leader”), which can be hard on the hands over time. Our dotfiles include a Karabiner-Elements configuration that maps holding j + k together to the Leader key.

  • Standard: Ctrl+b + key
  • Ergonomic: Hold j and k simultaneously, then press key

This allows you to trigger any tmux command without ever leaving the home row.


If you prefer to manage your own config, follow these steps.

  • macOS or Linux
  • Homebrew (macOS) or equivalent package manager
  • A terminal emulator (Ghostty recommended)
Terminal window
brew install tmux sesh
Terminal window
git clone https://github.com/builtby-win/dotfiles.git ~/dotfiles
cd ~/dotfiles
stow -d stow-packages -t ~ tmux

This uses GNU Stow to symlink the config files into your home directory. Stow will warn you if there is a conflict — your existing files will not be overwritten.

  1. Install TPM (Tmux Plugin Manager):

    Terminal window
    git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  2. Start tmux:

    Terminal window
    tmux
  3. Press Leader then I (capital I) to install all plugins.

  4. Wait for the “Done” message at the bottom of the screen.

Add the back2vibing shell hook to your shell config so b2v can track sessions:

Terminal window
# Add to ~/.zshrc (or ~/.bashrc for bash)
eval "$(b2v shell-hook --shell zsh)"

Then restart your shell or reload:

Terminal window
source ~/.zshrc

These are the essential keybindings from our recommended config. All use Ctrl+b (or j+k) as the prefix (called “Leader”).

ShortcutWhat it doesWhen to use it
Leader SpaceOpen session pickerSwitch between projects
Leader /Command paletteForgot a keybinding? Search here
Leader dSplit pane verticallyRun an agent side-by-side
Leader gFloating terminalQuick command without leaving your pane
Leader TJump to last sessionBounce between two projects
  1. Open tmux: tmux
  2. Split a pane: Leader d
  3. Start an agent in one pane: b2v claude
  4. Switch to the other pane: Leader h or Leader l
  5. When the agent finishes, your focus should snap back to the agent’s pane.

If focus snaps back, you are all set.

The session picker (Leader Space) is powered by sesh and fzf. It has several modes:

KeyModeWhat it shows
j / kNavigateMove up and down the list
/SearchEnable fuzzy search
Ctrl+AAll sessionsReload the full list
Ctrl+TTmux onlyShow only tmux sessions
Ctrl+GConfigsShow config directories
Ctrl+XZoxideShow recently visited directories
xKillDelete a session

The right panel shows a live preview of the selected session’s windows and panes.

Our dotfiles config installs these plugins via TPM:

PluginWhat it does
tmux-resurrectSave and restore sessions across restarts
tmux-continuumAuto-save sessions in the background
tmux-fingersCopy text with keyboard hints (Leader f)
tmux-yankEnhanced clipboard integration
tmux-floaxFloating terminal overlay (Leader g)
tmux-fzf-urlOpen URLs from the pane with fzf (Leader u)