tmux for Openclaw

A powerful terminal multiplexing skill that enables Openclaw agents to remote-control interactive CLI sessions and scrape TTY output.

zhouyaya100
v1.0.0
Mar 8, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install tmux-temp

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install tmux-temp using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is tmux?

The tmux skill provides a robust interface for Openclaw Skills to interact with terminal-based applications that require a persistent or interactive TTY. Unlike standard background execution, this skill allows for granular control over terminal panes, enabling the injection of keystrokes and the capturing of screen buffers. This makes it an essential tool for managing complex CLI environments like REPLs, interactive debuggers, or long-running processes that need to be monitored in real-time.

By leveraging isolated sockets, this skill ensures that automated workflows do not interfere with a user's personal tmux sessions. It transforms the terminal into a programmable environment where AI agents can execute commands, wait for specific textual prompts, and retrieve historical output for analysis, providing a bridge between static automation and dynamic command-line interaction.

tmux Use Cases

  • Running and controlling interactive Python or Node.js REPLs programmatically.
  • Orchestrating multiple coding agents like Claude Code or Codex to perform parallel tasks across different git worktrees.
  • Monitoring long-running build or test processes by scraping pane history for specific success or failure patterns.
  • Debugging automated workflows by manually attaching to isolated tmux sessions to inspect the live state.
  • Automating CLI tools that do not support non-interactive modes by simulating human keystrokes.

How tmux Works

  1. The skill initializes an isolated tmux socket within a dedicated directory to ensure a clean execution environment.
  2. A new detached session or window is created, targeting a specific task or shell environment.
  3. Commands are sent to the terminal using the send-keys functionality, supporting both literal strings and control sequences like C-c.
  4. The agent monitors the output by capturing the pane's buffer or using specialized scripts to poll for specific regex patterns.
  5. Upon detecting a completion prompt or required text, the agent extracts the relevant data from the terminal history.
  6. Finally, the session or the entire socket server is terminated to free up system resources.

tmux Setup

The tmux skill requires tmux to be installed on your system (macOS or Linux/WSL). Configure the socket directory to manage isolated sessions for Openclaw Skills.

# Define the socket directory
export CLAWDBOT_TMUX_SOCKET_DIR="${TMPDIR:-/tmp}/clawdbot-tmux-sockets"
mkdir -p "$CLAWDBOT_TMUX_SOCKET_DIR"

# Initialize a session on a private socket
SOCKET="$CLAWDBOT_TMUX_SOCKET_DIR/clawdbot.sock"
tmux -S "$SOCKET" new -d -s openclaw-session

tmux Data Schema & Taxonomy

The skill organizes terminal data through a hierarchical structure of sockets, sessions, and panes.

Component Description Example Format
Socket Path The file system path to the tmux communication socket /tmp/clawdbot.sock
Target ID The specific identifier for a session, window, and pane session:window.pane (e.g., agent-1:0.0)
Pane Buffer The captured text output from the terminal screen UTF-8 String (Plain Text)
Metadata Information about active sessions and pane dimensions JSON / Key-Value Pairs

tmux Advanced Features

  • Isolated Socket Management: Run hundreds of parallel sessions without polluting the default tmux server.
  • wait-for-text Helper: A sophisticated polling script that allows agents to wait for specific terminal states with configurable timeouts and intervals.
  • Parallel Agent Orchestration: Launch and monitor dozens of AI coding agents simultaneously across different workdirs using a single socket.
  • Python REPL Optimization: Automatic environment configuration (PYTHON_BASIC_REPL=1) to ensure compatibility with keystroke injection.
  • Pane Scraping: Advanced history capture capable of retrieving thousands of lines of terminal output for deep context analysis.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0