The Challenge: Managing Multiple Claude Code Sessions

When running Claude Code on macOS using the built-in Terminal application, managing multiple concurrent sessions becomes cumbersome. Each new session requires opening a separate Terminal window, quickly cluttering your workspace.

The typical workflow presents additional challenges:

  1. Context switching: After delegating tasks to Claude, developers switch to other work. When returning later, Claude may be waiting for approval on an operation.
  2. Frontend development overhead: After Claude generates code, starting the preview requires switching to a browser window.
  3. Session management: Tracking multiple concurrent Claude sessions across different Terminal windows becomes mentally taxing.

Fortunately, a macOS terminal神器 (remarkable tool) exists that addresses all these requirements: cmux.

For developers who want to preview and edit files directly within the terminal without constant window switching, Yazi provides an excellent complementary solution.

cmux: The All-in-One Terminal Solution

Core Features

cmux offers an impressive array of features designed specifically for modern development workflows:

Notification System

  • Notification ring: Blue ring appears around panes with new alerts, with highlighted tabs
  • Notification panel: Centralized view of all notifications with one-click navigation to unread items

Built-in Browser

  • Side-by-side browser: Open browser in split screen next to terminal
  • Script control: Programmatically control browser behavior
  • Browser data import: Support for Chrome, Firefox, Arc, and other browsers with preserved login states

Tab and Split Management

  • Horizontal and vertical splits: Flexible pane arrangement
  • Sidebar: Displays branches, PRs, directories, ports, and notifications
  • Rich keyboard shortcuts: Comprehensive shortcut coverage for all operations

SSH Workspace

  • Direct SSH connection: cmux ssh connects directly to remote systems
  • Remote network browsing: Browser traffic routes through remote network
  • Drag-and-drop file transfer: Simply drag files to transfer

Claude Teams

  • Multi-agent collaboration: cmux claude-teams enables one-click multi-agent协作
  • Native split-screen display: Each agent gets its own pane

Technical Excellence

  • Native macOS: Built with Swift + AppKit for fast startup and low resource usage
  • Ghostty compatibility: Directly reuse existing themes and font configurations
  • GPU rendering: Based on libghostty for smoother display performance
  • Comprehensive shortcuts: Extensive keyboard shortcut coverage for workspaces, panes, and browser operations

Configuration

cmux reads configuration from Ghostty configuration files. If you've previously used Ghostty, these options will feel familiar.

Open ~/.config/ghostty/config and add the following configuration:

# === Theme Settings ===
# Automatically switch between light and dark themes based on system
theme = dark:iTerm2 Dark Background,light:iTerm2 Light Background

# === Shell Integration ===
shell-integration = detect

# === Font Settings ===
font-size = 12
font-thicken = true
adjust-cell-height = 2

# === Window Settings ===
window-theme = system
window-save-state = always
background-opacity = 0.8
macos-titlebar-style = transparent

# === Mouse Settings ===
copy-on-select = clipboard
mouse-shift-capture = true
mouse-hide-while-typing = true
cursor-style = bar
cursor-style-blink = true
cursor-opacity = 0.85

# === Buffer Settings ===
scrollback-limit = 8388608

# === Quick Terminal ===
quick-terminal-position = top
quick-terminal-screen = mouse
quick-terminal-autohide = true
quick-terminal-animation-duration = 0.2

# === Security Settings ===
clipboard-paste-protection = true
clipboard-paste-bracketed-safe = true

Important: After modifying configuration, you must reload it (via menu bar operation).

Installation

Install cmux using Homebrew:

# brew tap manaflow-ai/cmux
brew install --cask cmux

Comprehensive Keyboard Shortcuts

Workspace Management

ShortcutOperation
⌘ NNew workspace
⌘ 1–8Jump to workspace 1–8
⌘ 9Jump to last workspace
⌃ ⌘ ]Next workspace
⌃ ⌘ [Previous workspace
⌘ ⇧ WClose workspace
⌘ ⇧ RRename workspace
⌘ BToggle sidebar

Interface Navigation

ShortcutOperation
⌘ TNew interface
⌘ ⇧ ]Next interface
⌘ ⇧ [Previous interface
⌃ TabNext interface
⌃ ⇧ TabPrevious interface
⌃ 1–8Jump to interface 1–8
⌃ 9Jump to last interface
⌘ WClose interface

Pane Splitting

ShortcutOperation
⌘ DSplit right
⌘ ⇧ DSplit down
⌥ ⌘ ← → ↑ ↓Switch focus by direction
⌘ ⇧ HFlash focused pane

Browser Controls

Browser developer tool shortcuts follow Safari defaults, customizable in Settings → Keyboard Shortcuts.

ShortcutOperation
⌘ ⇧ LOpen browser in split
⌘ LFocus address bar
⌘ [Go back
⌘ ]Go forward
⌘ RRefresh page
⌥ ⌘ IToggle developer tools (Safari default)
⌥ ⌘ CShow JavaScript console (Safari default)

Notification Management

ShortcutOperation
⌘ IShow notification panel
⌘ ⇧ UJump to latest unread

Find and Search

ShortcutOperation
⌘ FFind
⌘ G / ⌘ ⇧ GFind next / previous
⌘ ⇧ FHide find bar
⌘ EFind using selection

Terminal Operations

ShortcutOperation
⌘ KClear scrollback buffer
⌘ CCopy (when content selected)
⌘ VPaste
⌘ + / ⌘ -Increase / decrease font size
⌘ 0Reset font size

Window Management

ShortcutOperation
⌘ ⇧ NNew window
⌘ ,Settings
⌘ ⇧ ,Reload configuration
⌘ QQuit

Session Restoration

After restart, cmux restores application layout and metadata:

Restored:

  • Window/workspace/pane layout
  • Working directories
  • Terminal scrollback buffer (best effort)
  • Browser URLs and navigation history

Not Restored:

  • Processes running inside terminal (Claude Code, tmux, vim, etc.)

Notification System

cmux supports desktop notifications, enabling AI agents and scripts to alert you when attention is needed.

View all pending notifications in one place and quickly jump to the latest unread notification.

Ideal Workflow Setup

A typical productive setup might include:

  • Left pane: Claude Code session
  • Top-right pane: npm run dev development server
  • Bottom-right pane: Web browser for preview

This arrangement keeps all relevant context visible simultaneously, eliminating constant window switching.

Yazi: Terminal File Manager Integration

Introduction

Yazi (meaning "duck" in Chinese) is a terminal file manager written in Rust, built on non-blocking asynchronous I/O. It aims to provide efficient, user-friendly, and customizable file management experiences directly within the terminal.

Installation

Install Yazi and its dependencies:

brew install yazi ffmpeg-full sevenzip jq poppler fd ripgrep fzf zoxide resvg imagemagick-full font-symbols-only-nerd-font
brew link ffmpeg-full imagemagick-full -f --overwrite

Optional Integration

Add the following to the end of ~/.zshrc:

function y() {
  local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
  command yazi "$@" --cwd-file="$tmp"
  IFS= read -r -d '' cwd < "$tmp"
  [ "$cwd" != "$PWD" ] && [ -d "$cwd" ] && builtin cd -- "$cwd"
  rm -f -- "$tmp"
}

After saving, execute source ~/.zshrc to apply changes.

Now you can type y instead of yazi to launch the file manager in the terminal.

Configuration

Yazi has three configuration files:

  1. yazi.toml: General configuration
  2. keymap.toml: Key binding configuration
  3. theme.toml: Color scheme configuration

Show Hidden Files and Symlink Targets

Create ~/.config/yazi/yazi.toml:

[mgr]
show_hidden = true
show_symlink = true

Escape Key Behavior

Create ~/.config/yazi/keymap.toml:

[[input.prepend_keymap]]
on = "<Esc>"
run = ["close", "mgr:escape --filter"]
desc = "Close input and cancel the filter"

Essential Keyboard Shortcuts

Navigation

BindingAlternativeAction
kMove cursor up
jMove cursor down
lEnter hovered directory
hExit current directory to parent

File Operations

BindingAction
oOpen selected file
OOpen selected file interactively
EnterOpen selected file
Shift+EnterOpen selected file interactively (not supported in all terminals)
TabShow file information
yCopy selected files
xCut selected files
pPaste copied files
PPaste copied files (overwrite if exists)
Y or XCancel yank state
dDelete selected files to trash
DPermanently delete selected files
aCreate file (directories end with /)
rRename selected file
.Toggle hidden file visibility

Copy Paths

Press keys sequentially (e.g., c⇒d means press c, then d):

BindingAction
c⇒cCopy file path
c⇒dCopy directory path
c⇒fCopy filename
c⇒nCopy filename without extension

File Filtering

BindingAction
fFilter files

File Finding

BindingAction
/Find next file
?Find previous file
nGo to next found
NGo to previous found

File Searching

BindingAction
sSearch files by name using fd
SSearch files by content using ripgrep
Ctrl+sCancel ongoing search

Use Case: In-Terminal File Preview and Editing

With Yazi integrated into your terminal workflow, you can preview and edit file contents without leaving the terminal environment. This complements cmux perfectly, creating a fully terminal-based development environment.

Combined Workflow Benefits

Using cmux and Yazi together creates a powerful development environment:

  1. Reduced context switching: Everything visible in one place
  2. Improved focus: No need to constantly alt-tab between applications
  3. Better notification management: Never miss Claude's approval requests
  4. Efficient file operations: Quick file browsing and editing without leaving terminal
  5. Customizable layouts: Arrange panes to match your specific workflow

Conclusion

Modern development workflows increasingly rely on AI assistants like Claude Code. Tools like cmux and Yazi address the practical challenges of integrating these assistants into daily development work.

The combination provides:

  • Unified workspace for terminal, browser, and file management
  • Intelligent notifications for AI agent interactions
  • Flexible split-screen arrangements for multi-tasking
  • Native macOS performance with minimal resource overhead

For developers spending significant time with Claude Code or similar AI programming assistants, investing time in setting up these tools can substantially improve daily productivity and reduce the cognitive load of managing multiple concurrent sessions.


This guide explores terminal enhancement tools specifically designed for AI-assisted development workflows, providing comprehensive configuration details and practical usage examples for macOS developers.