Let Claude Code (or you) drive iTerm2 tabs and split panes from the command
line: open tabs, split them, cd somewhere, launch dev servers, read their
output back, and close them. Zero dependencies — it's a single zsh script built
on iTerm2's AppleScript API.
tabdriver list # windows/tabs/sessions (id + title)
tabdriver new-tab [--dir DIR] # prints new session id
tabdriver new-window [--dir DIR]
tabdriver split <id> (--right|--below) [--dir DIR]
tabdriver run <id> <command...> # sends command + Enter
tabdriver read <id> [--lines N] # dump pane contents
tabdriver wait <id> --for REGEX [--timeout SEC] # poll output for readiness
tabdriver name <id> <label> # set tab title
tabdriver close <id>
Every creating command prints the new session's UUID; all other commands address sessions by that id, so scripts (and Claude) can track exactly which pane is which.
P=~/code/myapp
T1=$(tabdriver new-tab --dir "$P"); tabdriver name "$T1" "api :5001"
tabdriver run "$T1" dotnet run --project Api/Api.Web
tabdriver wait "$T1" --for 'Now listening on' --timeout 120Once the skill is installed, you don't run any of the above yourself — just tell Claude Code things like:
"Start my dev stack in 4 tabs" · "Split this tab and tail the API logs" · "Is the Vite server still running? Check its tab."
Claude opens the tabs, names them, launches the commands, watches each pane's output until it sees a readiness line, and reports back what's running where.
The Claude Code skill lives in-repo at .claude/skills/tabdriver/, so just
opening this repo in Claude Code enables it for this project.
To make it available in every project (and put tabdriver on your PATH):
./install.shThis symlinks the skill into ~/.claude/skills/tabdriver and the CLI into
~/bin/tabdriver (if ~/bin exists). Because they're symlinks, git pull in
this repo updates the installed copy.
To uninstall:
./uninstall.sh- macOS + iTerm2 (running). No brew/pip packages needed.
- First mutating call triggers a one-time macOS prompt: "Terminal wants to control iTerm2" — click Allow (System Settings → Privacy & Security → Automation if you missed it).
readreturns the visible scrollback snapshot — great for readiness checks and diagnosis, not a complete log stream.- Split semantics:
--right= side by side,--below= stacked.