Skip to content

Command Reference

Complete reference for all tmux-cli commands.

Panes can be specified in two ways:

  • Pane number only — e.g. 2 (refers to pane 2 in the current window).
  • Full formatsession:window.pane, e.g. myapp:1.2 (for any pane in any session).

Launch a CLI application in a new tmux pane.

Terminal window
tmux-cli launch "command"
# Example: tmux-cli launch "python3"
# Returns: pane identifier (e.g. myapp:1.2)

Send input text to a pane.

Terminal window
tmux-cli send "text" --pane=PANE_ID

Options:

FlagDescription
--enter=FalseSend text without pressing Enter
--delay-enter=FalseSend immediately (no delay)
--delay-enter=0.5Custom delay in seconds

By default there is a 1.5-second delay between text and Enter, plus automatic Enter key verification with retry (up to 3 attempts).

Capture the current output from a pane.

Terminal window
tmux-cli capture --pane=PANE_ID

List all panes in the current window.

Terminal window
tmux-cli list_panes
# Returns: JSON with pane IDs, indices, and status

Show current tmux status and all panes.

Terminal window
tmux-cli status

Example output:

Current location: myapp:1.2
Panes in current window:
* myapp:1.0 zsh zsh
myapp:1.1 python3 python3
myapp:1.2 vim main.py

Kill a pane.

Terminal window
tmux-cli kill --pane=PANE_ID

Send Ctrl+C to a pane.

Terminal window
tmux-cli interrupt --pane=PANE_ID

Send the Escape key to a pane (useful for exiting vim-like applications or Claude).

Terminal window
tmux-cli escape --pane=PANE_ID

Wait until a pane has no output changes for a given duration.

Terminal window
tmux-cli wait_idle --pane=PANE_ID

Options:

FlagDefaultDescription
--idle-time2.0Seconds of silence before idle
--timeout30Max seconds to wait
Terminal window
# Custom idle time and timeout
tmux-cli wait_idle --pane=2 --idle-time=3.0 --timeout=60

Run a shell command and get both the output and exit code. Ideal for build/test automation.

Terminal window
tmux-cli execute "pytest tests/" --pane=2
# Returns JSON: {"output": "...", "exit_code": 0}

Options:

FlagDefaultDescription
--timeout30Max seconds (returns exit_code=-1 on timeout)

Python API:

from claude_code_tools.tmux_cli_controller import (
TmuxCLIController,
)
ctrl = TmuxCLIController()
result = ctrl.execute("make test", pane_id="ops:1.2")
# Returns: {"output": "...", "exit_code": 0}

Why use execute instead of send + capture?

  • Reliable exit codes — Know definitively if a command succeeded or failed.
  • No output parsing — No need to guess success by looking for “error” in text.
  • Proper automation — Build pipelines that abort on failure or retry on transient errors.

When NOT to use execute:

  • Agent-to-agent communication (Claude Code does not return exit codes).
  • Interactive REPL sessions (use send + wait_idle instead).
  • Long-running processes you want to monitor incrementally.

Display built-in documentation.

Terminal window
tmux-cli help

These commands are only available when running outside tmux:

Open the managed tmux session to view live.

Terminal window
tmux-cli attach

Kill the entire managed session and all its windows.

Terminal window
tmux-cli cleanup

Show all windows in the managed session.

Terminal window
tmux-cli list_windows
  • Always save the pane/window identifier returned by launch.
  • Use capture to check the current state before sending input.
  • Use status to see all available panes and their current state.
  • In local mode, pane identifiers can be full format (myapp:1.2) or just indices (1, 2).
  • In remote mode, window IDs can be indices (0, 1) or full form (session:0.0).
  • The tool prevents you from killing your own pane/window to avoid accidentally terminating your session.