feat: add `rtk tmux` wrapper for `capture-pane` and `send-keys`
#2,031 opened on May 22, 2026
Repository metrics
- Stars
- (48,085 stars)
- PR merge metrics
- (Avg merge 11d 1h) (45 merged PRs in 30d)
Description
feat: add rtk tmux wrapper for capture-pane and send-keys
Problem
Multi-pane tmux orchestration is a common pattern for Claude Code worker pools (e.g. CTO ↔ Worker-1 ↔ Worker-2/3). Two tmux commands dominate this workflow:
tmux capture-pane -t <target> -p— read another pane's output (often 100+ lines of build logs, test failures, etc.)tmux send-keys -t <target> ...— dispatch commands (short input, but spam-counted)
Measured impact (gma-ios, 30 days via rtk discover)
Command Count Example
tmux capture-pane 265 tmux capture-pane -t gma:1.2 -p
tmux send-keys 149 tmux send-keys -t gma:1.4 Escape
capture-pane is the costly one — it often returns 200+ lines of stale log output where the LLM only needs the last 20 lines or a specific anchor (e.g. last "DONE" / "ERROR" marker).
Proposed solution
Add rtk tmux subcommand with:
capture-panefilters:- Default to last N=50 lines (override with
-S -200flag — pass through native) - Add
--since-marker <regex>to capture only output after a specific marker - Strip blank trailing lines (tmux pads to pane height)
- Default to last N=50 lines (override with
send-keysfilters:- Suppress output entirely on success (it has no meaningful return)
- Only print on error
Example before/after
Before (tmux capture-pane -t gma:1.2 -p, ~150 lines / ~3KB):
[120 lines of stale starship prompt + old build output]
...
❯ /leader /tmp/wo-foo-brief.md
[20 lines of leader analysis]
❯
After (rtk tmux capture-pane -t gma:1.2 -p, ~25 lines / ~500 bytes):
- Last 50 lines, trailing blanks stripped → focuses LLM on recent activity
Why useful
Worker-pool / agent-orchestration patterns are growing in Claude Code (RTK's own discover history shows it). capture-pane token waste compounds — every poll burns context.
Environment
- RTK 0.40.0 (Homebrew, macOS arm64)
- Use case: gma-ios — 4-pane tmux harness for AI worker orchestration