iTerm2 Split Pane verification fails despite it2 CLI working correctly

Resolved 💬 3 comments Opened Feb 21, 2026 by gongpyung Closed Feb 25, 2026

Bug Description

When spawning teammates (Agent Teams), Claude Code detects iTerm2 and attempts to use native split panes via the it2 CLI. The verification step always fails even though it2 works correctly, causing:

  1. The "iTerm2 Split Pane Setup" prompt appears every time a teammate is spawned
  2. Verification fails with: "it2 CLI is not installed or not in PATH"
  3. Falls back to tmux/in-process mode

Environment

  • Claude Code: 2.1.50
  • OS: macOS (Darwin 25.2.0)
  • Terminal: iTerm2 (TERM_PROGRAM=iTerm.app)
  • it2 CLI: 0.2.0 (installed via pip, Python-based)
  • iTerm2 Python API: Enabled (EnableAPIServer = 1)
  • Shell: zsh

Steps to Reproduce

  1. Install it2 CLI: pip install --user it2
  2. Ensure it2 is in PATH
  3. Enable iTerm2 Python API in Preferences > General > Magic
  4. Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in settings
  5. Spawn a teammate using the Task tool with team_name parameter

Expected Behavior

  • it2 is found in PATH, verification passes, teammates appear as iTerm2 split panes

Actual Behavior

  • "iTerm2 Split Pane Setup" prompt appears every spawn
  • Verification fails despite it2 being fully functional
  • Falls back to tmux

Evidence: it2 works correctly inside Claude Code

All of these succeed when run from Claude Code's Bash tool:

$ which it2
/Users/user/.local/bin/it2

$ it2 --version
it2, version 0.2.0

$ it2 session list
# Successfully lists all iTerm2 sessions

$ it2 session split --vertical
# Successfully creates a new split pane
Created new pane: 496193BA-D324-472D-831E-D2C58512BF90

Analysis

The internal verification function appears to check it2 connectivity differently than the standard it2 session commands. The verification fails even though:

  • it2 is in PATH and executable
  • iTerm2 Python API is enabled and connectable
  • it2 session split successfully creates panes from within Claude Code

Additional Context

  • Setting ITERM_SHELL_INTEGRATION_INSTALLED=Yes in settings.json env was also needed to prevent iTerm2 shell integration escape sequences from corrupting subprocess communication
  • The it2check shell utility (different from the Python it2 CLI) also fails in Claude Code's context because it checks [ ! -t 0 ] (TTY check)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗