ワンクリックで
tmux
Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | tmux |
| description | Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output. |
| metadata | {"source":"https://github.com/mitsuhiko/agent-stuff/tree/main/skills/tmux"} |
Use tmux as a programmable terminal multiplexer for interactive work. Works on Linux and macOS with stock tmux; always use a private socket and clean config to avoid interference from the user's tmux setup.
SOCKET_DIR=${AGENT_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/agent-tmux-sockets} # well-known dir for all agent sockets
mkdir -p "$SOCKET_DIR"
SOCKET="$SOCKET_DIR/agent.sock" # keep agent sessions separate from your personal tmux
SESSION=agent-python # slug-like names; avoid spaces
tmux -S "$SOCKET" -f /dev/null new -d -s "$SESSION" -n shell
tmux -S "$SOCKET" send-keys -t "$SESSION" -- 'PYTHON_BASIC_REPL=1 python3 -q' Enter
# After Python starts, send code with -l then Enter separately:
# tmux -S "$SOCKET" send-keys -t "$SESSION" -l -- '2 + 2'
# tmux -S "$SOCKET" send-keys -t "$SESSION" Enter
tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION" -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 agent-lldb
Or to capture the output once:
tmux -S "$SOCKET" capture-pane -p -J -t agent-lldb -S -200
This must ALWAYS be printed right after a session was started and once again at the end of the tool loop. But the earlier you send it, the happier the user will be.
AGENT_TMUX_SOCKET_DIR (defaults to ${TMPDIR:-/tmp}/agent-tmux-sockets) and use tmux -S "$SOCKET" so we can enumerate/clean them. Create the dir first: mkdir -p "$AGENT_TMUX_SOCKET_DIR".SOCKET="$AGENT_TMUX_SOCKET_DIR/agent.sock".-t agent-py). This targets the active pane of the active window, works regardless of base-index setting, and avoids hardcoding window/pane indices that may be wrong.{session}:{window}.{pane} but avoid hardcoded indices — base-index may be 0 or 1 depending on config, making :0.0 unreliable.split-window), resolve indices dynamically:
base=$(tmux show-option -gv base-index)
pbase=$(tmux show-option -gv pane-base-index)
target="agent-py:${base}.${pbase}"
tmux -S "$SOCKET" list-panes -a -F '#{session_name}:#{window_index}.#{pane_index}'-f /dev/null when creating sessions (tmux -S "$SOCKET" -f /dev/null new ...). This guarantees base-index=0, no custom keybindings, no status bar plugins, and no user config interfering with send-keys or capture-pane. Only omit -f /dev/null if you explicitly need the user's ~/.tmux.conf.-S "$SOCKET" consistently to stay on the private socket path.tmux -S "$SOCKET" list-sessions, tmux -S "$SOCKET" list-panes -a.~/.agents/skills/tmux/scripts/find-sessions.sh -S "$SOCKET"; add -q partial-name to filter.~/.agents/skills/tmux/scripts/find-sessions.sh --all (uses AGENT_TMUX_SOCKET_DIR or ${TMPDIR:-/tmp}/agent-tmux-sockets).Multi-command bash one-liners MUST use line continuations (\) after && to keep output readable. Every && gets its own line:
# RIGHT — each command on its own line; use wait-for-text.sh to sync
SOCKET_DIR=${TMPDIR:-/tmp}/agent-tmux-sockets && \
SOCKET="$SOCKET_DIR/test-agent.sock" && \
SESSION=pi-test && \
tmux -S "$SOCKET" send-keys -t "$SESSION" -- 'PYTHON_BASIC_REPL=1 python3 -q' Enter && \
~/.agents/skills/tmux/scripts/wait-for-text.sh -S "$SOCKET" -t "$SESSION" -p '^>>>' -T 15 && \
tmux -S "$SOCKET" send-keys -t "$SESSION" -l -- 'some command here' && \
tmux -S "$SOCKET" send-keys -t "$SESSION" Enter
# WRONG — unreadable wall of text; also uses sleep instead of wait-for-text.sh
SOCKET_DIR=${TMPDIR:-/tmp}/agent-tmux-sockets && SOCKET="$SOCKET_DIR/test-agent.sock" && SESSION=pi-test && tmux -S "$SOCKET" send-keys -t "$SESSION" -- 'PYTHON_BASIC_REPL=1 python3 -q' Enter && sleep 2 && tmux -S "$SOCKET" send-keys -t "$SESSION" -l -- 'some command here' && tmux -S "$SOCKET" send-keys -t "$SESSION" Enter
Single-command lines need no continuation. If a chain has 3+ commands, break it up. This rule applies to ALL bash commands in tool calls, not just tmux.
Important: the -l flag sends all following arguments as literal text — including Enter. When using -l, send the text and Enter key as two separate commands:
# WRONG — sends literal text "Enter" instead of pressing Enter
tmux -S "$SOCKET" send-keys -t target -l -- 'some code' Enter
# RIGHT — send literal text, then Enter key separately
tmux -S "$SOCKET" send-keys -t target -l -- 'some code'
tmux -S "$SOCKET" send-keys -t target Enter
For simple commands without special characters, omit -l and use -- to delimit tmux options from the command:
tmux -S "$SOCKET" send-keys -t target -- 'echo hello' Enter
When composing inline commands, use single quotes or ANSI C quoting to avoid expansion: tmux ... send-keys -t target -- $'python3 -m http.server 8000'.
To send control keys: tmux ... send-keys -t target C-c, C-d, C-z, Escape, etc.
tmux -S "$SOCKET" capture-pane -p -J -t target -S -200.tmux wait-for (which does not watch pane output).tmux -S "$SOCKET" attach -t "$SESSION"; detach with Ctrl+b d.Some special rules for processes:
PYTHON_BASIC_REPL=1 environment variable. This is very important as the non-basic console interferes with your send-keys.~/.agents/skills/tmux/scripts/wait-for-text.sh -S "$SOCKET" -t "$SESSION" -p '^>>>' -T 15 -l 4000
"Type quit to exit", "Program exited", etc.) before proceeding.tmux ... send-keys -- 'PYTHON_BASIC_REPL=1 python3 -q' Enter; wait for ^>>>; send code with -l in a separate send, then Enter in another; interrupt with C-c.tmux ... send-keys -- 'gdb --quiet ./a.out' Enter; disable paging tmux ... send-keys -- 'set pagination off' Enter; break with C-c; issue bt, info locals, etc.; exit via quit then confirm y.tmux -S "$SOCKET" kill-session -t "$SESSION".tmux -S "$SOCKET" list-sessions -F '#{session_name}' | xargs -r -n1 tmux -S "$SOCKET" kill-session -t.tmux -S "$SOCKET" kill-server.~/.agents/skills/tmux/scripts/wait-for-text.sh polls a pane for a regex (or fixed string) with a timeout. Works on Linux/macOS with bash + tmux + grep.
~/.agents/skills/tmux/scripts/wait-for-text.sh -t session -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000] [-S socket-path | -L socket-name]
-t/--target pane target (required). Use session-only (e.g. agent-py) for the active pane; use {session}:{window}.{pane} only when you need a specific pane.-p/--pattern regex to match (required); add -F for fixed string-T timeout seconds (integer, default 15)-i poll interval seconds (default 0.5)-l history lines to search from the pane (integer, default 1000)-S/--socket-path tmux socket path (passed to tmux -S)-L/--socket tmux socket name (passed to tmux -L)Delegate work to a pi instance running in an isolated tmux session. Results come from files, not terminal output — keeping context clean. Use the delegate_task tool provided by the tmux-delegate extension. Use when delegating multi-file refactors, code reviews, or test generation. Not for tasks fitting 2-3 inline tool calls.
Allows to interact with web pages by performing actions such as clicking buttons, filling out forms, and navigating links. It works by remote controlling Google Chrome, Chromium, or Arc browsers using the Chrome DevTools Protocol (CDP). When Claude needs to browse the web, it can use this skill to do so.
Web search and content extraction via Brave Search API. All execution runs in Docker — no host dependencies required beyond Docker. API key managed by pass.
Research a topic then build a self-contained HTML slide deck with sidebar navigation. Use when asked to create a presentation, slide deck, or interactive guide from research.
Validate and render Mermaid diagrams. Defaults to ASCII output. Generates SVG (dark-themed) only when user requests it. All rendering runs in Docker — no host dependencies required. Use when creating, editing, or verifying Mermaid syntax.
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.