Tmux

From bighardperson/computer-science-skills-collection · View interactive version

Tmux is an AI agent skill from the GitHub repository bighardperson/computer-science-skills-collection. Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.

How to use this skill

Skill file

tmux Skill

Use tmux only when you need an interactive TTY. Prefer bash background mode for long-running, non-interactive tasks.

Quickstart (isolated socket)

SOCKET_DIR="${TMPDIR:-/tmp}/codebuddy-tmux-sockets"
mkdir -p "$SOCKET_DIR"
SOCKET="$SOCKET_DIR/codebuddy.sock"
SESSION=codebuddy-python

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

Socket convention

Targeting panes

Finding sessions

Sending input safely

Watching output

Cleanup

Helper: wait-for-text.sh

{baseDir}/scripts/wait-for-text.sh -t session:0.0 -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000]
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.