tmux

Control tmux sessions by sending keystrokes and capturing pane output.

327|85|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/letta-ai/lettabot --skill tmux-letta-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tmux
Source: https://github.com/letta-ai/lettabot/tree/main/.skills/tmux
Command: npx skills add https://github.com/letta-ai/lettabot --skill tmux-letta-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tmux, and includes scripts (resource) components.

What problem does it solve?

This Skill enables automating the control of tmux sessions to drive interactive CLIs by sending keystrokes and scraping pane output, eliminating manual session management.

Core Features & Use Cases

  • Create and manage tmux sessions on demand from your AI agent.
  • Send keystrokes to specific panes and capture pane output for real-time decisions.
  • Orchestrate multiple sessions across tasks like automated testing, debugging, or long-running shells.
  • Use Case: Example: Run a Python REPL in a session, feed code, and read results back for analysis.

Quick Start

Set a private socket directory and start a detached session; connect and interact via tmux commands. Example steps:

SOCKET_DIR="${CLAWDBOT_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/clawdbot-tmux-sockets}" mkdir -p "$SOCKET_DIR" SOCKET="$SOCKET_DIR/clawdbot.sock" SESSION=clawdbot-shell

tmux -S "$SOCKET" new -d -s "$SESSION" -n shell tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'bash' Enter tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200

Frequently Asked Questions about tmux

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate sending keystrokes to a tmux session from a script?

You can automate tmux sessions by using send-keys to transmit keystrokes to specific panes and capture-pane to scrape the output. This enables programmatic control over interactive CLIs for automated testing and debugging.

Can I capture terminal output from a detached tmux session programmatically?

Yes, you can capture terminal output from a detached tmux session by running the capture-pane command with parameters to print the text and specify the scrollback buffer. This retrieves pane content for real-time analysis.

Do I need tmux installed locally to orchestrate terminal sessions with an AI agent?

Yes, you need tmux installed locally because the Skill operates by executing native tmux commands to create sockets, manage sessions, send keystrokes, and capture pane output directly through the terminal multiplexer.

What is the best way to run and interact with a Python REPL in an automated terminal workflow?

The best way to interact with a Python REPL is to start a detached tmux session, send bash and python commands via send-keys, then use capture-pane to read the results back. This orchestrates the REPL without manual input.

How does managing multiple tmux sessions help with long-running shell tasks?

Managing multiple tmux sessions allows you to orchestrate long-running shells by keeping processes detached and isolated. You can connect to specific sessions on demand to send keystrokes and capture pane output across tasks.

Why use a private socket directory when starting automated tmux sessions?

Using a private socket directory when starting tmux sessions isolates the server connections, preventing interference from other local tmux processes. Set the directory path via environment variables to ensure consistent session management.