tmux

Send keystrokes and scrape pane output from tmux sessions.

3|Updated Oct 25, 2025
One-click install
npx skills add https://github.com/codekiln/langstar --skill tmux-codekiln
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tmux
Source: https://github.com/codekiln/langstar/tree/main/.claude/skills/tmux
Command: npx skills add https://github.com/codekiln/langstar --skill tmux-codekiln

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Remote control tmux sessions for interactive command-line work. Send keystrokes and scrape pane output from Python REPLs, debuggers, and other interactive terminal applications. Use when working with interactive CLI tools, debugging sessions, or REPL-driven development.

Core Features & Use Cases

  • Programmable control: Send keys to specific tmux sessions and panes; capture and inspect pane output for debugging.
  • Session isolation: Use private sockets to avoid clashing with your personal sessions.
  • Observed workflows: Ideal for interactive CLIs, debugging sessions, and REPL-driven development.

Quick Start

Set up an isolated socket and start a session:

  • Create a private socket directory, e.g., SOCKET_DIR=${TMPDIR:-/tmp}/claude-tmux-sockets and mkdir -p "$SOCKET_DIR"
  • Define SOCKET="$SOCKET_DIR/claude.sock" and SESSION=claude-python
  • Start a new tmux session: tmux -S "$SOCKET" new -d -s "$SESSION" -n shell
  • Send a command: tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'python3 -q' Enter
  • Capture output: 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 control of tmux sessions from a script or agent?

Automate tmux sessions by sending keystrokes and capturing pane output through a private socket. Use tmux -S $SOCKET to send commands to specific sessions and panes, then scrape output with capture-pane to inspect results. This enables remote control of interactive CLI tools, debuggers, and REPLs without manual intervention.

Can I use tmux to drive interactive terminal applications like Python REPLs or debuggers?

Yes. tmux multiplexing lets you send keystrokes to Python REPLs, debuggers, and other interactive terminal applications, then read their output programmatically. Create an isolated session on a private socket, send keys with send-keys, and capture pane content to automate workflows that normally require manual typing.

What's the best way to isolate automated tmux sessions from my personal terminal sessions?

Use private sockets per agent to isolate automated sessions. Define CLAUDE_TMUX_SOCKET_DIR (defaulting to a temp directory) and pass -S $SOCKET to tmux commands. This prevents clashes with existing sessions and keeps automation separate from your personal terminal work.

How do I capture and inspect output from a running tmux pane?

Capture pane output using tmux capture-pane -p -J -t $SESSION:pane-id -S -N, where -S sets scroll-back lines. This returns visible pane text for parsing and debugging. Use this to wait for prompts, check command results, and verify state before sending the next keystroke.

What are the setup requirements for automating tmux sessions?

You need a stock tmux installation on Linux or macOS, a private socket directory, and supporting scripts for session management. Set CLAUDE_TMUX_SOCKET_DIR, create the directory, define SOCKET and SESSION names, then start a tmux session with tmux -S $SOCKET new-session. No additional dependencies required.