← Back to Skills Marketplace
yuanshenstarto

Code Tmux

by yuanshenstarto · GitHub ↗ · v1.3.0 · MIT-0
cross-platform ⚠ suspicious
120
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install code-tmux
Description
Run coding tasks using a persistent tmux session with git worktree isolation. Supports multiple coding agents (Claude Code, Codex, CodeBuddy, OpenCode, etc.)...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install code-tmux
  3. After installation, invoke the skill by name or use /code-tmux
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug code-tmux
Version 1.3.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Code Tmux?

Run coding tasks using a persistent tmux session with git worktree isolation. Supports multiple coding agents (Claude Code, Codex, CodeBuddy, OpenCode, etc.)... It is an AI Agent Skill for Claude Code / OpenClaw, with 120 downloads so far.

How do I install Code Tmux?

Run "/install code-tmux" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Code Tmux free?

Yes, Code Tmux is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Code Tmux support?

Code Tmux is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Code Tmux?

It is built and maintained by yuanshenstarto (@yuanshenstarto); the current version is v1.3.0.

💬 Comments