Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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
.claude/skills/microck-using-tmux-for-interactive-commands/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-08 | ✓→✓ | = Same ✓ | 353% | 0% |
| case-18 | ✓→✓ | = Same ✓ | -1% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 257% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 149% | 0% |
Interactive 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 |
bash# This hangs because vim expects interactive terminal bash -c "vim file.txt"
bash# 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:
bashtmux 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:
bash# 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>
bashtmux 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
bashtmux 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
bashtmux 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
bashtmux 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
bashtmux 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
bashtmux send-keys -t sess 'text' Enter # ✓ tmux send-keys -t sess 'text\n' # ✗
Problem: Orphaned tmux sessions accumulate
Fix: Always kill sessions when done
bashtmux kill-session -t session_name # Or check for existing: tmux has-session -t name 2>/dev/null
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | pass→pass | 2,557 | 1,873 | -27% | 1 | 1 | 0% | 370 | 1,677 | +353% | 0 | 0 | — |
case-18 | pass→pass | 18,002 | 9,516 | -47% | 1 | 1 | 0% | 2,930 | 2,895 | -1% | 0 | 0 | — |
case-01 | pass→pass | 3,059 | 2,438 | -20% | 1 | 1 | 0% | 489 | 1,748 | +257% | 0 | 0 | — |
case-02 | pass→pass | 4,030 | 2,351 | -42% | 1 | 1 | 0% | 682 | 1,697 | +149% | 0 | 0 | — |
case-03 | pass→pass | 5,344 | 3,543 | -34% | 1 | 1 | 0% | 821 | 1,876 | +129% | 0 | 0 | — |
case-04 | pass→pass | 5,985 | 3,783 | -37% | 1 | 1 | 0% | 1,020 | 1,830 | +79% | 0 | 0 | — |
case-05 | pass→pass | 8,829 | 5,558 | -37% | 1 | 1 | 0% | 1,572 | 2,277 | +45% | 0 | 0 | — |
case-06 | pass→pass | 2,433 | 2,359 | -3% | 1 | 1 | 0% | 419 | 1,634 | +290% | 0 | 0 | — |
case-07 | pass→pass | 8,315 | 3,571 | -57% | 1 | 1 | 0% | 1,310 | 1,821 | +39% | 0 | 0 | — |
case-09 | pass→pass | 3,449 | 2,191 | -36% | 1 | 1 | 0% | 501 | 1,659 | +231% | 0 | 0 | — |
case-10 | pass→pass | 3,794 | 1,926 | -49% | 1 | 1 | 0% | 544 | 1,552 | +185% | 0 | 0 | — |
case-11 | fail→fail | 11,063 | 4,549 | -59% | 1 | 1 | 0% | 1,922 | 2,116 | +10% | 0 | 0 | — |
case-12 | pass→pass | 4,406 | 3,686 | -16% | 1 | 1 | 0% | 835 | 2,047 | +145% | 0 | 0 | — |
case-13 | pass→pass | 14,669 | 8,371 | -43% | 1 | 1 | 0% | 2,280 | 2,754 | +21% | 0 | 0 | — |
case-14 | pass→pass | 3,690 | 1,830 | -50% | 1 | 1 | 0% | 569 | 1,616 | +184% | 0 | 0 | — |
case-15 | pass→pass | 8,232 | 2,749 | -67% | 1 | 1 | 0% | 1,265 | 1,742 | +38% | 0 | 0 | — |
case-16 | pass→pass | 8,538 | 5,069 | -41% | 1 | 1 | 0% | 1,505 | 2,226 | +48% | 0 | 0 | — |
case-17 | fail→pass | 11,584 | 10,523 | -9% | 1 | 1 | 0% | 2,109 | 3,205 | +52% | 0 | 0 | — |
case-19 | pass→pass | 5,901 | 1,480 | -75% | 1 | 1 | 0% | 508 | 1,573 | +210% | 0 | 0 | — |
case-20 | pass→pass | 5,190 | 3,192 | -38% | 1 | 1 | 0% | 800 | 1,836 | +130% | 0 | 0 | — |
case-21 | pass→pass | 12,068 | 8,618 | -29% | 1 | 1 | 0% | 2,103 | 2,640 | +26% | 0 | 0 | — |
case-22 | pass→pass | 11,262 | 4,167 | -63% | 1 | 1 | 0% | 1,812 | 2,034 | +12% | 0 | 0 | — |
case-23 | pass→pass | 11,176 | 4,944 | -56% | 1 | 1 | 0% | 1,619 | 2,117 | +31% | 0 | 0 | — |
case-24 | pass→pass | 13,371 | 4,826 | -64% | 1 | 1 | 0% | 2,017 | 2,103 | +4% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +4 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.