Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Control iTerm from an agent: inspect windows/tabs/sessions, focus targets, create tabs/windows/splits/2x2 grids, close scoped targets safely, set iTerm badges, send commands to panes, run health checks, and take screenshots. Use when the user asks to manage iTerm panes, tabs, windows, badges, layouts, or agent sessions inside iTerm.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -25% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -21% | 0% |
Use this skill to control iTerm topology and pane state through the bundled CLI. Prefer the CLI over hand-written AppleScript.
bashskills/iterm-control/scripts/iterm-control identify skills/iterm-control/scripts/iterm-control health skills/iterm-control/scripts/iterm-control list skills/iterm-control/scripts/iterm-control focus --target session:<id> skills/iterm-control/scripts/iterm-control badge --target caller --text "Regi" skills/iterm-control/scripts/iterm-control tab --target caller --command "zsh -lc 'cd \"$PWD\" && exec codex'" skills/iterm-control/scripts/iterm-control window --target caller --command "zsh -lc 'cd \"$PWD\" && exec codex'" skills/iterm-control/scripts/iterm-control split --target caller --direction right --command "zsh -lc 'cd \"$PWD\" && exec codex'" skills/iterm-control/scripts/iterm-control grid --target caller --rows 2 --cols 2 --command "zsh -lc 'cd \"$PWD\" && exec codex'" skills/iterm-control/scripts/iterm-control screenshot --output /tmp/iterm-check.png
When installed locally, the same script is usually available at:
bash~/.agents/skills/iterm-control/scripts/iterm-control ~/.claude/skills/iterm-control/scripts/iterm-control ~/.codex/skills/iterm-control/scripts/iterm-control
Use explicit targets for mutating actions:
caller: the terminal that invoked the agent, matched by TTY when possible.current: iTerm's current session in the current window.session:<id>: exact iTerm session id from list or identify.tty:<path>: exact TTY path, for example tty:/dev/ttys003.If caller cannot be matched because the agent runtime is not attached to a TTY, the CLI falls back to iTerm's current session and reports caller-fallback-current in JSON. Treat that as user-visible focus and verify before destructive actions.
Create a right split and start a command:
bashiterm-control split --target caller --direction right --command "zsh -lc 'cd /path/to/repo && exec codex'"
Create a new tab in the caller/current window and start a command:
bashiterm-control tab --target caller --command "zsh -lc 'cd /path/to/repo && exec codex'"
Create a 2x2 grid while preserving the caller pane:
bashiterm-control grid --target caller --rows 2 --cols 2 --command "zsh -lc 'cd /path/to/repo && exec codex'"
Set a badge without typing into the shell:
bashiterm-control badge --target session:<id> --text "worker-1"
Send a command to a pane:
bashiterm-control send --target tty:/dev/ttys005 --text "git status"
Validate layout visually:
bashiterm-control screenshot --output /tmp/iterm-layout.png
Focus an existing pane or tab:
bashiterm-control focus --target session:<id>
Open a new window for a separate worker:
bashiterm-control window --target caller --command "zsh -lc 'cd /path/to/repo && exec codex'"
Close a known temporary tab or window after validation:
bashiterm-control close --target session:<id> --scope tab --force iterm-control close --target session:<id> --scope window --force
identify or list before mutating layout.health when diagnosing targeting, fallback, or session readiness.session:<id> or tty:<path> after the first lookup.tab; it creates the new tab in the same iTerm window as the target session.window; it creates a new iTerm window with the target profile by default.focus; it selects the target window, tab, and session.session:<id> or tty:<path> target. Pass --force only when the target scope is intentionally current or not at a shell prompt.send for a pane running a full-screen TUI unless the user asked.badge; it writes the OSC 1337 sequence directly to the target TTY.Other measured skills in the registry, with their headline benchmark lift.