BlogTerminals and tmux
Do I need tmux to run several Claude Code sessions?
No. Each Claude Code session is an ordinary terminal process, so tabs or splits in Ghostty, iTerm2 or Terminal.app are enough to run several side by side. tmux earns its place when you want sessions that keep running after you close the window or lose an SSH connection. As of October 2026, Claude Code's own background sessions cover much of that case without tmux.
What tmux gives you
tmux runs your shells inside a server process. When you detach (C-b d), the client exits and the session keeps running in the background, with every program inside it. You reattach later:
tmux new -s agents # new session named "agents"
# ... C-b d to detach
tmux attach -t agents # come back
For Claude Code, that means three things:
- Persistence: sessions survive closing the terminal app.
- Remote work: start agents on a server over SSH, disconnect, reconnect later.
- Scriptable layout: one command can open a pane per worktree.
If you need none of those, tmux is optional.
Without Kanbell: three setups
Setup A: native tabs and splits, no tmux
Ghostty supports multiple windows, each with its own tabs and splits, drawn with native macOS components. iTerm2 has split panes too. Open one tab per worktree:
claude -w feature-auth
claude -w billing-fix
This is the simplest setup. Desktop notifications work out of the box in Ghostty and iTerm2 (iTerm2 needs forwarding turned on).
Setup B: tmux, configured for Claude Code
Inside tmux, by default, Shift+Enter submits instead of adding a newline, and desktop notifications never reach the outer terminal. Add this to ~/.tmux.conf:
set -g allow-passthrough on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
Then apply it to the running server:
tmux source-file ~/.tmux.conf
Claude Code can create the tmux session for you when you start a worktree:
claude -w feature-auth --tmux
It uses iTerm2 native panes when available; --tmux=classic forces plain tmux.
In iTerm2, tmux -CC turns tmux windows into native iTerm2 tabs and windows: splitting a pane in iTerm2 splits the tmux window.
Setup C: background sessions instead of tmux
If what you want from tmux is "keep running when I close the terminal", try Claude Code's background sessions:
claude --bg "fix the flaky settings test"
claude agents # see every background session and its state
A supervisor process runs them, so you can close agent view and your shell and the work continues. They are preserved across sleep and stop if the machine shuts down. Agent view is a research preview as of October 2026.
Limits of each setup
Native tabs:
- A session lives in its tab: close the tab and you close the shell running it.
- Nothing groups tabs by project or tells you which tab is waiting.
tmux:
- More panes means smaller panes. Past a handful, you switch between windows anyway.
- A terminal-status feature, OSC 7501, which shows each session as working, waiting or done in supporting terminals, doesn't reach your terminal from inside tmux: Claude Code checks tmux for support instead.
- Agent teams in split-pane mode need tmux or iTerm2 and aren't supported in Ghostty, VS Code's terminal or Windows Terminal.
- Another layer to configure and to debug.
Background sessions:
- They only track Claude Code.
- Interactive sessions you open in other terminals don't appear in agent view until you background them.
With Kanbell
Kanbell is a macOS app (Apple Silicon) with terminals built in, so you get panes and tabs without setting up tmux.
- One window per project, with real terminals in panes and tabs. Start
claude,claude -w,codexor any CLI agent in them. - Waiting state across all of them. For Claude Code: working, waiting or done, and whether it waits on a question or a permission. Codex CLI and Gemini CLI show state and permission waits. An orange dot appears in the window, the menu bar and the overview, with a macOS notification; ⌘⇧J jumps to the next agent that waits.
- Git, board and notes in the same window: changes, diffs, history and worktrees; a local or GitHub Issues board; markdown notes per project.
If you run agents on a remote server over SSH and need them to survive disconnects, tmux is still the right tool for that part.
Which one to pick
- Two or three local sessions: native tabs.
- Remote servers, or you already live in tmux: tmux with the config above.
- Hand-off work you check on later: background sessions and
claude agents. - Several projects with interactive sessions, and you want to see which agent waits: Kanbell. See the best terminal for Claude Code on Mac for the trade-offs.
FAQ
What tmux settings does Claude Code need?
Add set -g allow-passthrough on, set -s extended-keys on and set -as terminal-features 'xterm*:extkeys' to ~/.tmux.conf. The first lets notifications reach the outer terminal; the other two make Shift+Enter insert a newline.
Does Claude Code keep running if I close the terminal?
An interactive session lives in its terminal. Background sessions started with claude --bg or from claude agents keep running without a terminal, are preserved across sleep, and stop if the machine shuts down.
Do agent teams need tmux?
Only for split-pane display. The default in-process mode works in any terminal; split panes need tmux or iTerm2 with the it2 CLI.
Is there a shortcut for a worktree plus tmux?
Yes. claude -w feature-auth --tmux creates a tmux session for the worktree, using iTerm2 native panes when available.