agentleFS
richardkmichaelrichardkmichael/claude-rodin/skills/tmux/SKILL.md

tmux

Skill0 starsChanged 49 days agoMITView on GitHub

Use interactive CLIs (python, gdb, lldb, etc.) with tmux by sending keystrokes and scraping pane output.

69 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use taskflow-inbox-triage, session-logs and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AtomicBot-aiSkill

    taskflow-inbox-triage

    Also in 6 projects that use this

  • seedprodSkill

    session-logs

    Search and analyze your own session logs (older/parent conversations) using jq.

    Also in 20 projects that use this

  • seedprodSkill

    voice-call

    Start voice calls via the OpenClaw voice-call plugin.

    Also in 18 projects that use this

  • AtomicBot-aiSkill

    taskflow

    Also in 7 projects that use this

  • jiulingyunSkill

    BlueBubbles

    为Clawdbot构建或更新BlueBubbles外部通道插件(扩展包,REST发送/探测,webhook入站)。

    Also in 16 projects that use this

  • hkyutongSkill

    openclaw-release-maintainer

    Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.

    Also in 4 projects that use this

  • +5 more from seedprod

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 64 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use tmux as a programmable terminal multiplexer for interactive work.

    line 16
  2. Very specific:

    Always pass -i ${CLAUDE_SESSION_ID} when starting sessions.

    line 20
  3. Very specific:

    Use --monitor when the user asks to watch or says "show me".

    line 38
  4. Distinctive:

    Do not use it by default.

    line 39
  5. Very specific:

    All pane output is automatically logged to ${TMPDIR:-/tmp}/claude-tmux-logs/

    line 48
  6. Very specific:

    Run with -h for help.

    line 53
  7. Very specific:

    Prefer send-and-wait.sh — it sends the command and polls for expected output:

    line 65
  8. Very specific:

    Stop servers with stop-session.sh.

    line 129

“Common” is measured: kept by at least 6 in 10 of the 64 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

tmux Skill

Use tmux as a programmable terminal multiplexer for interactive work.

Quickstart

Always pass -i ${CLAUDE_SESSION_ID} when starting sessions.

# Start a server for a purpose (returns JSON with socket/session/target/log)
${CLAUDE_SKILL_DIR}/scripts/start-session.sh -i ${CLAUDE_SESSION_ID} -s python
# {"socket": "claude/<id>/python", "session": "claude-python-<id>", "target": "...", "log": "..."}

# Send a command and wait for expected output
${CLAUDE_SKILL_DIR}/scripts/send-and-wait.sh -L $SOCKET -t $TARGET -c 'python -q' -p '>>>' -l

# Each purpose gets its own server
${CLAUDE_SKILL_DIR}/scripts/start-session.sh -i ${CLAUDE_SESSION_ID} -s gdb

A PostToolUse hook automatically shows the user the log path (and monitor command if --monitor was not used) after start-session.sh runs.

Pass --monitor to open an Alacritty window attached to the server. Use --monitor when the user asks to watch or says "show me". Do not use it by default.

Architecture

Each -s call creates an isolated tmux server via -L claude/<session-id>/<name>. Sockets are stored in tmux's default directory (usually /tmp/tmux-<uid>/).

  • Pass --monitor to open an Alacritty monitoring window for the server
  • Stopping a server closes its Alacritty window naturally
  • All pane output is automatically logged to ${TMPDIR:-/tmp}/claude-tmux-logs/
  • User can discover all sockets via find-sessions.sh

Scripts

Run with -h for help.

ScriptPurpose
start-session.shStart server, returns JSON {socket, session, target, log}
stop-session.shStop a server (-s name) or all servers (no -s)
find-sessions.shList all claude-* sessions across sockets
wait-for-text.shPoll pane for pattern with timeout
send-and-wait.shSend command and wait for output

Sending commands

Prefer send-and-wait.sh — it sends the command and polls for expected output:

${CLAUDE_SKILL_DIR}/scripts/send-and-wait.sh -L $SOCKET -t $TARGET -c 'print("hello")' -p 'hello' -l

-l sends literally (avoids shell expansion). Omit for key sequences.

For commands with no predictable output, use raw send-keys + capture:

tmux -L $SOCKET send-keys -t $TARGET -l -- "$text"
tmux -L $SOCKET send-keys -t $TARGET Enter
tmux -L $SOCKET capture-pane -p -J -t $TARGET -S -200

Control keys (no -l):

tmux -L $SOCKET send-keys -t $TARGET C-c   # interrupt
tmux -L $SOCKET send-keys -t $TARGET C-d   # EOF

Testing tmux key bindings

send-keys writes bytes directly into the pane's PTY. The tmux prefix interception happens in the client layer (between the terminal and the server), so send-keys bypasses it entirely. Sending C-t via send-keys delivers the raw byte to the shell, not to the tmux binding system.

Consequence: key bindings cannot be triggered via send-keys. What can be tested:

  • The bound commands work correctly — extract the command from the binding and run it directly against the server with tmux -L $SOCKET <command> -t $TARGET .... For example, if the binding runs select-layout even-horizontal, test it as:
    tmux -L $SOCKET select-layout -t $TARGET even-horizontal
  • The binding is registered — query list-keys with the specific key. For example, to check key Space:
    tmux -L $SOCKET list-keys Space

What cannot be tested without a human at a real terminal: the full keystroke path (terminal → client intercepts prefix → dispatches binding → command runs).

Interactive tool recipes

  • Python REPL:
    ${CLAUDE_SKILL_DIR}/scripts/send-and-wait.sh -L $SOCKET -t $TARGET -c 'PYTHON_BASIC_REPL=1 python -q' -p '>>>'
    ${CLAUDE_SKILL_DIR}/scripts/send-and-wait.sh -L $SOCKET -t $TARGET -c 'print(42)' -p '>>>' -l
  • lldb/gdb: Disable paging with set pagination off, break with C-c

Cleanup

Kill your server when done. All pane output is preserved in the log file.

# Kill one server
${CLAUDE_SKILL_DIR}/scripts/stop-session.sh -i ${CLAUDE_SESSION_ID} -s python

# Kill all servers for this session
${CLAUDE_SKILL_DIR}/scripts/stop-session.sh -i ${CLAUDE_SESSION_ID}

Stop servers with stop-session.sh. Never run tmux kill-server without -L: that kills the user's own tmux server. The script also removes the claude/<id>/ socket entries.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.