← 返回 Skills 市场
yuanshenstarto

Code Tmux

作者 yuanshenstarto · GitHub ↗ · v1.3.0 · MIT-0
cross-platform ⚠ suspicious
120
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install code-tmux
功能描述
Run coding tasks using a persistent tmux session with git worktree isolation. Supports multiple coding agents (Claude Code, Codex, CodeBuddy, OpenCode, etc.)...
使用说明 (SKILL.md)

Coding Agent Task (tmux + worktree)

Run coding tasks by spawning a coding agent in a tmux session + git worktree. Every task gets its own isolated branch and persistent conversation.

Step 0: Determine which agent to use

Check memory first:

memory_search("preferred coding agent tool")
  • If found → use that tool, no need to ask

  • If not found → ask the user:

    "Which coding agent should I use? (default: claude) Options: claude, codex, opencode, codebuddy, or any CLI tool name"

    Then save the answer to memory:

    memory: preferred_coding_agent = \x3Ctool>
    

    Write to MEMORY.md under a "Preferences" section.

Default if user doesn't answer: claude

Step 1 & 2: Setup worktree + Start session

If tool is claude (recommended)

Use claude -w — it manages the worktree automatically. Add --tmux to also create a tmux session:

cd \x3Cproject>
# worktree + tmux in one command:
claude -w \x3Cbranch-name> --tmux --dangerously-skip-permissions
  • -w \x3Cname> creates and checks out a new git worktree branch automatically
  • --tmux opens it in a tmux session (uses iTerm2 panes if available, otherwise classic tmux)
  • No need to manually git worktree add or tmux new-session

If tool is other (codex, opencode, codebuddy, etc.)

Manage worktree and tmux manually:

# Create worktree
git -C \x3Cproject> worktree add -b \x3Cbranch> \x3Cworktree-path> main

# Symlink env files
ln -sf \x3Cproject>/.env \x3Cworktree-path>/.env
ln -sf \x3Cproject>/.env.local \x3Cworktree-path>/.env.local   # if exists

# Create tmux session and launch agent
tmux new-session -d -s \x3Ctask-name> -c \x3Cworktree-path>
tmux send-keys -t \x3Ctask-name> "nvm use 20 && \x3Ctool-command>" Enter
Tool Command
codex codex
opencode opencode
codebuddy codebuddy (or check its CLI name)
other use the tool's interactive CLI command

Step 3: Send task with plan-first instruction

For claude -w --tmux, the session name is auto-set to the branch name. Find it with:

tmux list-sessions

Then send the task:

tmux send-keys -t \x3Csession-name> -l -- "Your task here.

Before making any changes, show me a plan of what you intend to do and wait for my approval."
sleep 0.1
tmux send-keys -t \x3Csession-name> Enter

Step 4: Relay plan to user

# Poll for plan output
tmux capture-pane -t \x3Ctask-name> -p | tail -30

When agent outputs a plan → relay it to the user, wait for their confirmation before proceeding.

Relay flow:

  1. Agent outputs plan → relay to user
  2. User says "ok" / requests changes → forward to agent
  3. Agent proceeds → monitor and relay further questions
# Send user's response
tmux send-keys -t \x3Ctask-name> -l -- "\x3Cuser response>"
sleep 0.1
tmux send-keys -t \x3Ctask-name> Enter

# Check if waiting for input
tmux capture-pane -t \x3Ctask-name> -p | tail -10 | grep -E "❯|Yes.*No|proceed|permission|plan|approve"

Step 5: Parallel tasks

Same pattern, multiple sessions:

tmux new-session -d -s task-a -c /tmp/task-a
tmux new-session -d -s task-b -c /tmp/task-b

Check all at once:

for s in task-a task-b; do
  echo "=== $s ==="
  tmux capture-pane -t $s -p 2>/dev/null | tail -5
done

Step 6: Cleanup

For claude -w --tmux (worktree auto-managed):

tmux kill-session -t \x3Cbranch-name>
git worktree remove \x3Cworktree-path>   # branch preserved

For other tools (manual worktree):

git -C \x3Cproject> worktree remove \x3Cworktree-path>   # branch preserved
tmux kill-session -t \x3Ctask-name>

User can then test in main workspace:

git switch \x3Cbranch>

Rules

  • Check memory first — never ask for tool preference if already saved
  • Always use worktrees — one per task, no exceptions
  • Always use tmux — persistent session, multi-turn conversation
  • Always show plan first, wait for user approval before agent touches files
  • Always symlink .env files — don't copy
  • One status message when starting, one when done or stuck
  • See references/troubleshooting.md for common issues
安全使用建议
This skill does what it says (orchestrates tmux + git worktrees) but has several red flags you should consider before installing or using it: 1) Metadata omission — the registry claims no required binaries/env vars, yet the instructions require git, tmux, Node/nvm, and external coding-agent CLIs; ask the author to correct the metadata. 2) Secrets exposure — the skill explicitly tells you to symlink your project's .env/.env.local into task worktrees; that gives any spawned agent process direct access to credentials/API keys. Avoid symlinking secrets unless you trust the agent CLI absolutely; prefer sanitized envs or run tasks in an isolated container/VM. 3) Dangerous flags and automated responses — the recommended '--dangerously-skip-permissions' flag and auto-sending 'y' to prompts can bypass safeguards; investigate what that flag does for the specific agent CLI (claude). 4) Persistent files — the skill writes preferences to MEMORY.md; review that file and where memory is stored. 5) Run in isolation — if you try it, run it in a disposable environment (container, VM, or throwaway repo) and verify agent behavior before letting it operate on important code or secrets. If you plan to adopt it for regular use, request the maintainer to: (a) declare required binaries and config paths in metadata, (b) remove or make optional the .env symlink step, (c) remove recommendations to bypass permissions, and (d) document exactly what data the agent will see and what the memory persistence does.
功能分析
Type: OpenClaw Skill Name: code-tmux Version: 1.3.0 The code-tmux skill is a legitimate utility designed to manage coding agents (such as Claude Code or Codex) within isolated git worktrees and persistent tmux sessions. It includes safety-oriented instructions in SKILL.md, such as requiring the agent to present a plan for user approval before modifying files and using the '-l' flag in 'tmux send-keys' to ensure user input is treated literally. No evidence of malicious intent, data exfiltration, or unauthorized persistence was found.
能力评估
Purpose & Capability
The skill is described as a tmux+git-worktree orchestration helper, which matches the SKILL.md intent. However the registry metadata declares no required binaries or env vars while the runtime instructions clearly require git, tmux, Node/nvm, and one or more external coding-agent CLIs (claude, codex, opencode, codebuddy, etc.). That mismatch is incoherent: a skill that runs external CLIs should list those as required.
Instruction Scope
SKILL.md instructs the agent to create/kill tmux sessions, add/remove git worktrees, symlink the project's .env and .env.local into task worktrees, send keystrokes into interactive CLIs, capture panes, and even auto-send 'y' to prompts. These actions grant access to repository files and any secrets in .env, and run arbitrary CLI processes that could exfiltrate data. The file-write instruction (save preferred agent to MEMORY.md) and the explicit recommendation to use '--dangerously-skip-permissions' broaden the scope in ways that are not justified by the metadata.
Install Mechanism
This is instruction-only (no install spec or code files), which reduces installer risk. The README suggests 'npx clawhub@latest install ...' or cloning a GitHub repo, but there is no formal install specification in the registry. That's a minor inconsistency but not itself malicious.
Credentials
Declared required env vars/binaries are empty, yet the instructions require access to .env/.env.local (symlinking them into worktrees), plus git/tmux/node/nvm and external agent CLIs. Symlinking .env exposes local secrets to the spawned agent processes. The skill asks to persist a preference to MEMORY.md (file-write) but does not declare any config path permissions. Overall, requested and implied environment access is broader than the declared requirements.
Persistence & Privilege
The skill does not set always:true (good). It relies on the agent to run external processes and persist per-task branches/sessions, which is consistent with its purpose. However, combined with autonomous invocation (platform default) and the ability to run arbitrary CLIs and access .env files, this increases the practical blast radius if misused — consider restricting autonomous execution or running in an isolated environment.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install code-tmux
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /code-tmux 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.3.0
claude tool now uses 'claude -w --tmux' for native worktree+tmux management — no manual git worktree or tmux setup needed
v1.2.0
Renamed from claude-code-tmux. Supports multiple coding agents with memory-based preference.
元数据
Slug code-tmux
版本 1.3.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Code Tmux 是什么?

Run coding tasks using a persistent tmux session with git worktree isolation. Supports multiple coding agents (Claude Code, Codex, CodeBuddy, OpenCode, etc.)... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 120 次。

如何安装 Code Tmux?

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

Code Tmux 是免费的吗?

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

Code Tmux 支持哪些平台?

Code Tmux 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Code Tmux?

由 yuanshenstarto(@yuanshenstarto)开发并维护,当前版本 v1.3.0。

💬 留言讨论