tmux

Control tmux sessions by sending keystrokes and capturing pane output.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/shalevamin/Tau_agent --skill tmux-shalevamin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tmux
Source: https://github.com/shalevamin/Tau_agent/tree/main/tau-agent-main/skills/tmux
Command: npx skills add https://github.com/shalevamin/Tau_agent --skill tmux-shalevamin

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Interactive terminal applications like Claude Code or long-running processes inside tmux sessions cannot be driven by simple one-off shell commands, making it hard to monitor output, respond to prompts, or send input programmatically. ## Core Features & Use Cases - Keystroke Injection: Send text, Enter, Escape, and Ctrl key combinations to any tmux session, window, or pane. - Output Scraping: Capture pane content or full scrollback history with capture-pane for monitoring and pattern matching. - Helper Scripts: Use find-sessions.sh to list sessions across sockets and wait-for-text.sh to poll a pane until a regex pattern appears or a timeout expires. - Use Case: While running multiple Claude Code worker sessions, check each pane for approval prompts, send 'y' plus Enter to confirm, and wait for a completion message before proceeding. ## Quick Start Ask the agent to list all running tmux sessions and show the last 20 lines of output from the session named shared.

Frequently Asked Questions about tmux

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

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

Use tmux send-keys with a target like session:window.pane, for example tmux send-keys -t shared "hello" Enter. For interactive TUIs, send the text and the Enter key as separate commands to avoid paste and multiline edge cases.

How to capture output from a tmux pane?

Run tmux capture-pane -t sessionname -p to print the pane content to stdout. Add -S - to capture the entire scrollback history, or pipe through tail to get only the most recent lines.

When should I use tmux instead of running a shell command directly?

Use tmux control only for interactive or long-running processes already inside a session, such as Claude Code workers. For one-off commands, new background processes, or non-interactive scripts, run them directly with an exec tool instead.

How do I wait for specific text to appear in a tmux pane?

Use the wait-for-text.sh script with a target pane and a regex pattern. It polls the pane output at a configurable interval and exits when the pattern matches or the timeout expires, printing the recent pane content on failure.

Can I list tmux sessions on non-default sockets?

Yes, the find-sessions.sh script accepts -L for a socket name, -S for a socket path, or -A to scan all sockets under the configured socket directory. It reports each session's name, attachment state, and creation time.