Engineering
tmux avatar

tmux

Remotely control tmux sessions for interactive CLIs by sending automated keystrokes and scraping pane output.

Introduction

The tmux skill provides a robust interface for interacting with terminal multiplexer sessions programmatically. It is specifically designed for agents that need to manage, monitor, and interact with long-running CLI applications, such as Claude Code, Codex, or other interactive build and debug tools. By leveraging tmux's native ability to detach and persist processes across SSH connections or terminal closures, this skill ensures that your automated workflows remain stable and observable regardless of host connectivity.

  • Precise input delivery by sending raw text or specific control sequences (e.g., Ctrl+C, Enter, Escape) to active terminal panes.

  • Real-time output capture and screen scraping from specific tmux windows and panes, allowing the agent to react to CLI prompts, error messages, or status updates.

  • Seamless window and pane navigation, enabling the agent to switch context between parallel background worker sessions and primary interfaces.

  • Stateful session management, including listing, creating, renaming, and terminating sessions to maintain a clean development environment.

  • Safely handles interactive TUI (Terminal User Interface) prompts by splitting text input and execution commands to prevent pasting errors and multiline formatting issues.

  • Always verify the target session identifier format (session:window.pane) before executing commands to ensure input is sent to the correct workspace.

  • Use the capture-pane -p command to pipe output directly to logs or parsing functions; use -S - to grab the entire scrollback buffer when reviewing historical process logs.

  • While this skill is powerful for interactive CLI interaction, do not use it for simple one-off shell scripts; utilize the standard exec tool for non-interactive commands to minimize overhead.

  • To detect when a session requires attention, pipe captured output into regex filters to look for interaction indicators like ❯, permission requests, or proceed prompts.

  • Sessions are persisted automatically, making this an ideal choice for background worker management, long-running deployments, and parallelized CLI tasks.

Repository Stats

Stars
366,073
Forks
75,055
Open Issues
6,981
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
Apr 29, 2026, 08:03 AM
View on GitHub