iTerm2: install, features, tmux -CC and coding agents
iTerm2 3.7.9 for macOS 13+: install with Homebrew, profiles, split panes, hotkey window, tmux -CC, and Claude Code's Shift+Enter, Option keys and alerts.
iTerm2 is a free, open-source terminal app for the Mac, the most common replacement for Apple’s Terminal. The current release is 3.7.9 (November 20, 2026), a security fix to install if you are on anything older, and the 3.7 line needs macOS 13 Ventura or later. Install it from iterm2.com or with brew install --cask iterm2. What it adds over Terminal: split panes, a hotkey window, searchable profiles, shell integration, triggers, and a native view of tmux sessions with tmux -CC. For coding agents, Claude Code’s Shift+Enter works in it with no setup; Option shortcuts need Left and Right Option set to “Esc+”, and desktop notifications need iTerm2’s alert settings turned on.
What iTerm2 is
iTerm2 is a terminal emulator: the window you type commands into, on macOS only. It is written by George Nachman, is free, and its source is on GitHub, with bugs tracked on GitLab. The project’s home page still says it runs on macOS 10.14 or newer, but every 3.7 release on the downloads page is marked “macOS 13+”, and so is the Homebrew cask; an older Mac needs an older iTerm2 from the same page.
It does not run on Linux or Windows, and it is never what runs on a server. When your coding agent lives on a remote machine, iTerm2 stays on the Mac and you reach the machine over SSH. If you are choosing a terminal rather than setting one up, Ghostty and Alacritty are the usual alternatives, and both also run on Linux.
Installing it
Download the stable build from the downloads page, which marks it “the recommended build for most users”, or use Homebrew:
brew install --cask iterm2CopiedHomebrew marks the cask as auto-updating: iTerm2 keeps itself current, and iTerm2, Check for Updates asks on demand. The version tags on GitHub are nightly builds; the stable version is the one on iterm2.com, 3.7.9 as of December 2026.
The features people install it for
| Feature | What it does | Where to find it |
|---|---|---|
Split panes | Several shells in one tab, side by side or stacked | Shell menu, Split Vertically or Split Horizontally |
Hotkey window | A terminal that drops down over whatever app you are in, on a key you choose | Settings, Keys, “Create a Dedicated Hotkey Window” |
Profiles | Saved sets of colours, fonts, keys and a start command, taggable and searchable; a profile can open an SSH session to a server | Settings, Profiles |
Shell integration | Marks each prompt, alerts when a long command finishes, keeps per-host command history and recent directories | iTerm2 menu, Install Shell Integration |
Triggers | Actions that run when output matches a regular expression, such as ringing the bell, showing an alert or sending text | Settings, Profiles, Advanced, Triggers |
tmux integration | Shows a tmux session’s windows and panes as real iTerm2 tabs and splits | tmux -CC, below |
Find, autocomplete, copy mode, paste history, instant replay | Search the scrollback, complete words already on screen, select with the keyboard, re-paste, scroll back to text a program erased | Edit and Session menus |
The hotkey window is a profile of its own, named “Hotkey Window”, with options to stay pinned when it loses focus and to float over full-screen apps. Shell integration supports bash, zsh, fish 2.3 and later, tcsh and xonsh, and the installer is one command if you would rather not use the menu:
curl -L https://iterm2.com/shell_integration/install_shell_integration.sh | bashCopiedThat pipes a script from the internet into your shell; the menu also offers an “Internet-Free Install” that downloads nothing. Shell integration has to be installed on each server you SSH into as well, and inside ordinary tmux it is off unless your login script sets ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX=1 before loading it. Under tmux -CC it works as is.
Version 3.7 (September 8, 2026) added tab groups, a status line on each tab that programs can set, workgroups of related panes, an AI chat that can watch and operate your sessions, and an iPhone companion app, iTerm2 Buddy, for that chat. The parts that matter for agents are below.
Setting it up for Claude Code and Codex
Three settings decide how a coding agent behaves in iTerm2, and Anthropic’s terminal page names each for iTerm2 as of December 2026.
New lines with Shift+Enter
Works without setup. Inside tmux it also needs tmux’s extended keys (the four lines further down); outside tmux there is nothing to do. Ctrl+J, or \ then Enter, adds a line in any terminal. The Claude Code new-line guide has the table for every other terminal.
Option shortcuts
Claude Code uses Option for shortcuts such as Option+P to switch models and Option+Enter for a new line, and iTerm2 does not send Option as a modifier by default. Open Settings, Profiles, Keys, General, and set both Left Option key and Right Option key to “Esc+”. Do it on each profile you run agents in, the hotkey window’s included, since it is a separate profile. Running /terminal-setup in Claude Code in iTerm2 does something different: it turns on “Applications in terminal may access clipboard” (Settings, General, Selection) so that /copy can write to your Mac’s clipboard; restart iTerm2 afterwards for it to take effect.
Desktop notifications
Claude Code detects iTerm2 and sends a desktop notification when it finishes or stops for a permission prompt while you seem to be away. iTerm2 drops it until you allow it, once per profile:
- Settings, Profiles, Terminal: tick “Notification Center Alerts”.
- Click “Filter Alerts” and enable “Send escape sequence-generated alerts”.
- In macOS System Settings, Notifications, check that iTerm2 is allowed to notify.
When Claude Code runs on a server you reach over SSH, outside tmux, leave preferredNotifChannel in the server’s ~/.claude/settings.json at its default, "auto". Claude Code before v2.1.326 needs it set to "iterm2" on the server:
{
"preferredNotifChannel": "iterm2"
}CopiedSince 3.7, iTerm2 posts these whenever it is not the active app or the window is not in front, and has a setting to suppress them from the session you are looking at. Codex has its own switch, tui.notification_method, covered with the rest in the Claude Code notifications guide, which also reaches a phone.
iTerm2’s own Claude Code integration
iTerm2 3.7 has a menu item, iTerm2, Install Claude Code Integration. It turns on iTerm2’s Python API (the one required step), adds a hook it calls cc-status to ~/.claude/settings.json, and then shows each Claude Code tab as working, waiting or idle, which is the point when several run at once. Optional steps add a “workgroup” that opens a diff view and a code-review pane beside the chat, and triggers that open it when claude starts. iTerm2, Uninstall Claude Code Integration removes the hook, the workgroup and the triggers again. The status staying “working” while background tasks run needs Claude Code 2.1.198 or later.
The integration’s page describes a hook on the Mac and a local connection to iTerm2, and says nothing about Claude Code running on a server. Reading the two together, the integration is built for claude running on the Mac itself; for an agent on a server, the notification above is the part that crosses SSH.
Claude Code’s experimental agent teams (off until you set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) can give each teammate its own pane, which needs tmux or iTerm2. For iTerm2’s own panes, install the it2 command-line tool, turn on Settings, General, Magic, Enable Python API, and set "teammateMode": "auto" (or "iterm2") in ~/.claude/settings.json.
tmux -CC: an agent on a server that outlives the Mac
A coding agent started in an iTerm2 tab stops when the shell it runs in goes away: close the lid and the SSH connection drops, and the agent on the server goes with it. tmux on the server is what keeps it running, and tmux -CC is iTerm2’s way of showing that tmux session as ordinary iTerm2 tabs and splits, with iTerm2’s own scrollback, search and copy, instead of tmux’s status bar and prefix keys. Anthropic’s agent-teams page calls tmux -CC in iTerm2 “the suggested entrypoint into tmux”. The tmux guide covers tmux itself.
With tmux installed on the server, this opens a session named agent, or attaches to it if it is already there. Know one thing before you run it: in iTerm2, closing a tab or window that shows tmux “kills the tmux session or window”, the agent in it included. To step away and leave it running, use Shell, tmux, Detach instead.
ssh -t you@your-server tmux -CC new -A -s agentCopiedThe session’s windows open as iTerm2 tabs or windows. Start claude or codex in one of them and leave it working. When the Mac sleeps, the network drops or iTerm2 quits, the tabs close and tmux keeps the agent running on the server; running the same command later brings the tabs back as they were. Since tmux is the only thing on the server, any terminal can pick up the same session with plain tmux attach -t agent, a phone’s SSH app included, just without iTerm2’s native tabs.
Three more things catch people out:
- No mixing. A tab showing a tmux window cannot also hold an ordinary local split pane.
- One size for everyone. tmux windows are never larger than the smallest client attached, so a phone attached at the same time shrinks the Mac’s view, and iTerm2 shows a grey band where the window is larger than tmux allows.
- Keys and notifications still go through tmux. Since 3.7, Shift+Enter and Ctrl+J reach programs such as Codex inside tmux integration. Claude Code’s tmux advice applies on the server as well; add these lines to its
~/.tmux.conf:
set -g allow-passthrough on
set -g focus-events on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'CopiedThen run tmux source-file ~/.tmux.conf, detach, attach again and restart the agent. allow-passthrough needs tmux 3.3 or later, and with it only a pane in a window you are viewing sends its notification. Anthropic’s page writes about tmux in general and does not mention control mode, so whether the notification reaches iTerm2 through a -CC session is not something either project’s docs state; test it once with a short task before relying on it. Session options live under iTerm2’s Settings, General, tmux.
iTerm2’s own AI features
iTerm2 has an AI chat (Session, Open AI Chat) that you link to terminal sessions. It works with a model you configure under Settings, General, AI: it has presets for OpenAI-compatible providers such as Ollama and OpenRouter, takes models on your own network over plain HTTP, and keeps a separate API key for each provider, so a hosted model means bringing your own key. Each kind of access the chat has in a session, among them viewing contents, running commands and controlling the terminal, is a permission you set to Never, Ask or Always. With viewing set to Always, the visible screen goes with every message you send, which matters when a secret is on it. An “orchestration” chat added in 3.7 can read every session and must ask before typing into one, and the iPhone app, paired by QR code under iTerm2, Companion Device Settings, carries that chat to your phone through an encrypted relay.
None of it is needed to run Claude Code or Codex in iTerm2. The project describes its AI plugin as an optional component that enables the generative AI features, kept separate “to ensure that there’s no way to accidentally send information from the terminal over the network”. In 3.7, the guided first-time setup installs it along with the iPhone app’s plugin and asks for your API key; since 3.7.5, pairing the phone no longer needs the AI plugin or a key.
Versions and the 3.7.9 security fix
3.7.9 is a security update: in earlier versions a crafted file, merely displayed in the terminal with something like cat, could run commands by abusing the Kitty image and drag-and-drop protocols, according to its release notes. A coding agent prints a great deal of text it did not write, from repositories, logs and web pages, so an iTerm2 that runs agents is one to keep current, with iTerm2, Check for Updates.