← 返回 Skills 市场
rmbell09-lang

Lucky Tmux Controller

作者 rmbell09-lang · GitHub ↗ · v1.0.1 · MIT-0
darwinlinux ⚠ suspicious
123
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install lucky-tmux
功能描述
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
使用说明 (SKILL.md)

tmux Session Control

Control tmux sessions by sending keystrokes and reading output. Essential for managing Claude Code sessions.

When to Use

USE this skill when:

  • Monitoring Claude/Codex sessions in tmux
  • Sending input to interactive terminal applications
  • Scraping output from long-running processes in tmux
  • Navigating tmux panes/windows programmatically
  • Checking on background work in existing sessions

When NOT to Use

DON'T use this skill when:

  • Running one-off shell commands → use exec tool directly
  • Starting new background processes → use exec with background:true
  • Non-interactive scripts → use exec tool
  • The process isn't in tmux
  • You need to create a new tmux session → use exec with tmux new-session

Example Sessions

Session Purpose
shared Primary interactive session
worker-2 - worker-8 Parallel worker sessions

Common Commands

List Sessions

tmux list-sessions
tmux ls

Capture Output

# Last 20 lines of pane
tmux capture-pane -t shared -p | tail -20

# Entire scrollback
tmux capture-pane -t shared -p -S -

# Specific pane in window
tmux capture-pane -t shared:0.0 -p

Send Keys

# Send text (doesn't press Enter)
tmux send-keys -t shared "hello"

# Send text + Enter
tmux send-keys -t shared "y" Enter

# Send special keys
tmux send-keys -t shared Enter
tmux send-keys -t shared Escape
tmux send-keys -t shared C-c          # Ctrl+C
tmux send-keys -t shared C-d          # Ctrl+D (EOF)
tmux send-keys -t shared C-z          # Ctrl+Z (suspend)

Window/Pane Navigation

# Select window
tmux select-window -t shared:0

# Select pane
tmux select-pane -t shared:0.1

# List windows
tmux list-windows -t shared

Session Management

# Create new session
tmux new-session -d -s newsession

# Kill session
tmux kill-session -t sessionname

# Rename session
tmux rename-session -t old new

Sending Input Safely

For interactive TUIs (Claude Code, Codex, etc.), split text and Enter into separate sends to avoid paste/multiline edge cases:

tmux send-keys -t shared -l -- "Please apply the patch in src/foo.ts"
sleep 0.1
tmux send-keys -t shared Enter

Claude Code Session Patterns

Check if Session Needs Input

# Look for prompts
tmux capture-pane -t worker-3 -p | tail -10 | grep -E "❯|Yes.*No|proceed|permission"

Approve Claude Code Prompt

# Send 'y' and Enter
tmux send-keys -t worker-3 'y' Enter

# Or select numbered option
tmux send-keys -t worker-3 '2' Enter

Check All Sessions Status

for s in shared worker-2 worker-3 worker-4 worker-5 worker-6 worker-7 worker-8; do
  echo "=== $s ==="
  tmux capture-pane -t $s -p 2>/dev/null | tail -5
done

Send Task to Session

tmux send-keys -t worker-4 "Fix the bug in auth.js" Enter

Notes

  • Use capture-pane -p to print to stdout (essential for scripting)
  • -S - captures entire scrollback history
  • Target format: session:window.pane (e.g., shared:0.0)
  • Sessions persist across SSH disconnects
安全使用建议
This skill is functionally consistent with a tmux controller, but take precautions before installing or enabling it: - Understand it can read and send keystrokes to any tmux session accessible via the tmux socket(s) on the host — sensitive data (passwords, tokens, private code) in other panes could be exposed. Only use it on machines and sessions you trust. - The scripts look for OPENCLAW_TMUX_SOCKET_DIR / CLAWDBOT_TMUX_SOCKET_DIR; verify these environment variables (or the default /tmp path) so you know which sockets will be scanned. - Review the two bundled shell scripts locally to confirm no unexpected behavior (they are short and readable). They do not perform network I/O, but they do print pane contents to stdout/stderr on timeout. - If you need tighter control, run the scripts manually first or run the agent/skill in a sandbox/container that restricts access to tmux sockets you do not own. - Consider restricting autonomous use of the skill in the agent (disable autonomous invocation for sensitive workflows) or only enable it for sessions you control. If you want, I can point out exactly which lines reference the environment variables and where pane contents are printed so you can verify them yourself.
能力评估
Purpose & Capability
Name and description match the actual behavior: the skill requires the tmux binary and provides instructions and helper scripts to list sessions, capture pane output, wait for text, and send keys via tmux. That capability legitimately needs tmux and the provided commands. Note: the scripts support scanning a socket directory (OPENCLAW_TMUX_SOCKET_DIR / CLAWDBOT_TMUX_SOCKET_DIR) which is reasonable for multi-socket setups but is not declared in requires.env.
Instruction Scope
SKILL.md plus the scripts instruct the agent to capture pane output and send keystrokes. The included wait-for-text.sh prints captured pane contents on timeout and find-sessions.sh can enumerate sessions across sockets; both actions can read arbitrary terminal output from any session accessible via the tmux socket. The instructions do not explicitly warn about sensitive data exposure, and there is a small inconsistency (SKILL.md 'When NOT to Use' says not to create new sessions while the examples include tmux session management commands).
Install Mechanism
No install spec (instruction-only with two small shell scripts). No remote downloads or package installs; nothing is written to disk by an installer. This is the lower-risk category for install mechanisms.
Credentials
The manifest lists no required env vars, but scripts read OPENCLAW_TMUX_SOCKET_DIR and CLAWDBOT_TMUX_SOCKET_DIR (with a fallback into /tmp). Those env vars are optional but present in the runtime behavior and not declared up-front. Because tmux sockets control which sessions are accessible, these environment variables materially affect which sessions the skill can enumerate and read.
Persistence & Privilege
The skill does not request always:true and does not modify other skills or system-wide configs. It relies on the tmux binary and runs helper scripts; autonomous invocation is allowed (platform default) but not combined with any elevated persistent privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install lucky-tmux
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /lucky-tmux 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- No changes detected in this release. - Version number updated to 1.0.1.
v1.0.0
Initial release of lucky-tmux skill for remote tmux session management. - Enables sending keystrokes and scraping output from tmux panes for interactive CLI workflows. - Provides usage guidance for monitoring and controlling live terminal sessions, especially Claude Code sessions. - Includes common tmux commands for session, window, and pane operations. - Offers patterns for safely automating interactions and handling terminal prompts. - Supports both Darwin and Linux systems; requires tmux to be installed.
元数据
Slug lucky-tmux
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Lucky Tmux Controller 是什么?

Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 123 次。

如何安装 Lucky Tmux Controller?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install lucky-tmux」即可一键安装,无需额外配置。

Lucky Tmux Controller 是免费的吗?

是的,Lucky Tmux Controller 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Lucky Tmux Controller 支持哪些平台?

Lucky Tmux Controller 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(darwin, linux)。

谁开发了 Lucky Tmux Controller?

由 rmbell09-lang(@rmbell09-lang)开发并维护,当前版本 v1.0.1。

💬 留言讨论