Use when you need to run interactive CLI tools (vim, git rebase -i, Python REPL, etc.) that require real-time input/output - provides tmux-based approach for controlling interactive sessions through detached sessions and send-keys
/plugin marketplace add tianzecn/myclaudecode/plugin install tianzecn-superpowers-lab-plugins-superpowers-lab@tianzecn/myclaudecodeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
tmux-wrapper.shInteractive CLI tools (vim, interactive git rebase, REPLs, etc.) cannot be controlled through standard bash because they require a real terminal. tmux provides detached sessions that can be controlled programmatically via send-keys and capture-pane.
Use tmux when:
git rebase -i, git add -p)Don't use for:
| Task | Command |
|---|---|
| Start session | tmux new-session -d -s <name> <command> |
| Send input | tmux send-keys -t <name> 'text' Enter |
| Capture output | tmux capture-pane -t <name> -p |
| Stop session | tmux kill-session -t <name> |
| List sessions | tmux list-sessions |
# This hangs because vim expects interactive terminal
bash -c "vim file.txt"
# Create detached tmux session
tmux new-session -d -s edit_session vim file.txt
# Send commands (Enter, Escape are tmux key names)
tmux send-keys -t edit_session 'i' 'Hello World' Escape ':wq' Enter
# Capture what's on screen
tmux capture-pane -t edit_session -p
# Clean up
tmux kill-session -t edit_session
send-keys (can send special keys like Enter, Escape)capture-pane -p to see current screen stateCommon tmux key names:
Enter - Return/newlineEscape - ESC keyC-c - Ctrl+CC-x - Ctrl+XUp, Down, Left, Right - Arrow keysSpace - Space barBSpace - BackspaceSpecify working directory when creating session:
tmux new-session -d -s git_session -c /path/to/repo git rebase -i HEAD~3
For easier use, see /home/jesse/git/interactive-command/tmux-wrapper.sh:
# Start session
/path/to/tmux-wrapper.sh start <session-name> <command> [args...]
# Send input
/path/to/tmux-wrapper.sh send <session-name> 'text' Enter
# Capture current state
/path/to/tmux-wrapper.sh capture <session-name>
# Stop
/path/to/tmux-wrapper.sh stop <session-name>
tmux new-session -d -s python python3 -i
tmux send-keys -t python 'import math' Enter
tmux send-keys -t python 'print(math.pi)' Enter
tmux capture-pane -t python -p # See output
tmux kill-session -t python
tmux new-session -d -s vim vim /tmp/file.txt
sleep 0.3 # Wait for vim to start
tmux send-keys -t vim 'i' 'New content' Escape ':wq' Enter
# File is now saved
tmux new-session -d -s rebase -c /repo/path git rebase -i HEAD~3
sleep 0.5
tmux capture-pane -t rebase -p # See rebase editor
# Send commands to modify rebase instructions
tmux send-keys -t rebase 'Down' 'Home' 'squash' Escape
tmux send-keys -t rebase ':wq' Enter
Problem: Capturing immediately after new-session shows blank screen
Fix: Add brief sleep (100-500ms) before first capture
tmux new-session -d -s sess command
sleep 0.3 # Let command initialize
tmux capture-pane -t sess -p
Problem: Commands typed but not executed
Fix: Explicitly send Enter
tmux send-keys -t sess 'print("hello")' Enter # Note: Enter is separate argument
Problem: tmux send-keys -t sess '\n' doesn't work
Fix: Use tmux key names: Enter, not \n
tmux send-keys -t sess 'text' Enter # ✓
tmux send-keys -t sess 'text\n' # ✗
Problem: Orphaned tmux sessions accumulate
Fix: Always kill sessions when done
tmux kill-session -t session_name
# Or check for existing: tmux has-session -t name 2>/dev/null
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.