ai-tools/shared-tmux-terminal/SKILL.md
Open a shared tmux terminal window that both Claude and the user can see and control simultaneously. Claude sends commands to it and reads the output automatically — no need to ask the user what happened. The user can type in it directly, including for sudo passwords, or to take over at any time. Use when the user wants a visible terminal, needs to run sudo commands, wants Claude to assist with terminal operations, or wants shared visibility of what Claude is doing.
npx skillsauth add randyhaylor/enhanceclaude shared-tmux-terminalInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Single terminal window shared by Claude and user. Claude drives it (sends commands, reads output autonomously). User can type at any time — including sudo passwords.
Follow these steps in order. Step 1 is mandatory — you MUST open a visible window before sending any commands.
Create the tmux session:
tmux new-session -s shared -d
Then open a terminal window attached to it (the user must be able to see it):
gnome-terminal -- tmux attach -t shared &
macOS: osascript -e "tell app \"Terminal\" to do script \"tmux attach -t shared\"""
If gnome-terminal is unavailable, detect the available terminal emulator first:
which gnome-terminal konsole xfce4-terminal lxterminal alacritty kitty 2>/dev/null
Always pipe pane output to a log file in the current chat session folder (not /tmp). This keeps logs scoped to the conversation and avoids cross-session collisions:
# Use the chat session folder for the log (agents should create this path)
tmux pipe-pane -t shared -o 'cat >> /home/aikenyon/.claude/sessions/<SESSION_ID>/tmux_shared.log'
If the session folder is unknown or unavailable, fall back to /tmp/tmux_shared.log.
Default: read log on demand (low token use). Start with a small tail, expand only if needed:
tail -3 <LOG_PATH> # check last few lines first
tail -50 <LOG_PATH> # expand if more context needed
Optional: Monitor tool (HIGH TOKEN USE — every line becomes a message). Offer to the user but don't enable by default:
Monitor({ description: "tmux output", command: "tail -f <LOG_PATH>", persistent: true })
Send commands to the window (user sees them live):
tmux send-keys -t shared 'your command here' Enter
ALWAYS verify the command started by reading the log file (tail the log, not capture-pane):
tail -3 <LOG_PATH>
Only use tmux capture-pane -t shared -p as a last resort — it captures only visible lines and is lossy. Prefer the piped log file for all output reading.
Interrupt a running command:
tmux send-keys -t shared C-c
Send the sudo command to the window. The user sees the password prompt and types it. Wait, then read the result:
tmux send-keys -t shared 'sudo apt install -y some-package' Enter
tmux has-session -t shared 2>/dev/null
xdotool; Mac: osascript; Windows: AutoHotkey/SetConsoleTitle — untested on non-Linux)printf to PTY won't work from Claude's subprocess. Discover the PTY dynamically:
WID=$(xdotool search --class "gnome-terminal" | while read w; do
echo "$w $(xdotool getwindowname $w)"; done | grep -v tmux | head -1 | awk '{print $1}')
TERM_PID=$(xdotool getwindowpid $WID)
for child in $(pgrep -P $TERM_PID); do ls -la /proc/$child/fd/0; done
# identify /dev/pts/N, then:
printf "\033]2;My Title\007" > /dev/pts/N
tools
# XState v5 Quick Reference ## How to Look Up API Details For complete function signatures, types, and interfaces, **grep `api-reference.md`** — do NOT read it in full (12k+ lines). Example: ``` Grep pattern="createActor" path="~/.claude/skills/xstate/api-reference.md" output_mode="content" -C 5 ``` Then use `Read` with `offset`/`limit` to get the full section. This is the primary way to get precise technical info when the quick reference below isn't enough. ## Design Workflow Recommended
tools
Workaround for agent teams in VS Code extension where TeamCreate teammates cannot execute tools. Uses an echo-back-and-resume pattern where agents return tool requests instead of executing them directly.
development
Format documentation, READMEs, and structured text using header hierarchy where each level stands alone. Use when creating docs, research notes, summaries, or when user requests 'scannable,' 'well-structured,' 'skimmable,' or 'readable at multiple depths' output. Applies to markdown, technical specs, and any hierarchical text formatting.
development
Enforce strict Test-Driven Development workflow: write one test, make it pass, verify, then proceed. Prevents over-implementation and ensures code matches requirements exactly. Use when implementing new features, adding settings, or building functionality incrementally.