This wraps tmux with a clean interface for driving interactive CLIs like Python REPLs, gdb, and other terminal programs. It runs sessions on isolated sockets so Claude's work doesn't collide with your personal tmux setup, sends keystrokes programmatically, and scrapes pane output to see what happened. The wait-for-text helper polls for prompts or completion markers so you can synchronize on slow commands without racing. Useful when you need Claude to debug with lldb, run interactive database shells, or babysit long-running terminal processes. The convention of printing monitor commands for users is thoughtful. Works on stock Linux and macOS tmux without custom config.

skills.sh installs
419
GitHub stars
3.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add mitsuhiko/agent-stuff --skill tmux --agent claude-code

Installs into .claude/skills of the current project.

Files

tmux Skill

Use tmux as a programmable terminal multiplexer for interactive work. Works on Linux and macOS with stock tmux; avoid custom config by using a private socket.

Quickstart (isolated socket)

SOCKET_DIR=${TMPDIR:-/tmp}/claude-tmux-sockets  # well-known dir for all agent sockets
mkdir -p "$SOCKET_DIR"
SOCKET="$SOCKET_DIR/claude.sock"                # keep agent sessions separate from your personal tmux
SESSION=claude-python                           # slug-like names; avoid spaces
tmux -S "$SOCKET" new -d -s "$SESSION" -n shell
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'python3 -q' Enter
tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200  # watch output
tmux -S "$SOCKET" kill-session -t "$SESSION"                   # clean up

After starting a session ALWAYS tell the user how to monitor the session by giving them a command to copy paste:

To monitor this session yourself:
  tmux -S "$SOCKET" attach -t claude-lldb

Or to capture the output once:
  tmux -S "$SOCKET" capture-pane -p -J -t claude-lldb:0.0 -S -200

Sponsors

Details

Repository
github.com/mitsuhiko/agent-stuff
Categories
AI & Agent Building, Python, CLI & Terminal
First seen
Jun 3, 2026

More from mitsuhiko/agent-stuff

All 6
1aj-geddes avatardistributed-tracingaj-geddes/useful-ai-promptsImplement distributed tracing with Jaeger and Zipkin for tracking requests across microservices. Use when debugging distributed systems, tracking request flows,418skills.sh installs
2aj-geddes avatarmulti-cloud-strategyaj-geddes/useful-ai-promptsDesign and implement multi-cloud strategies spanning AWS, Azure, and GCP with vendor lock-in avoidance, hybrid deployments, and federation.418skills.sh installs
3jwynia avatardna-extractionjwynia/agent-skillsExtract the functional DNA from existing works (TV, film, books, plays). Use when adapting a source work, when analyzing what makes something work, when creatin418skills.sh installs
4shiplightai avatarcompliance-reviewshiplightai/agent-skillscompliance review418skills.sh installs
5shiplightai avatardesign-reviewshiplightai/agent-skillsdesign review418skills.sh installs
6shiplightai avatarprivacy-reviewshiplightai/agent-skillsprivacy review418skills.sh installs