{"skill":{"slug":"tmux-controller","displayName":"Tmux","summary":"Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.","description":"---\nname: tmux\nslug: tmux-controller\nversion: 1.0.0\ndescription: Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.\nmetadata:\n  { \"openclaw\": { \"emoji\": \"🧵\", \"os\": [\"darwin\", \"linux\"], \"requires\": { \"bins\": [\"tmux\"] } } }\n---\n\n# tmux Skill\n\nUse tmux only when you need an interactive TTY. Prefer exec background mode for long-running, non-interactive tasks.\n\n## Default Server — No Custom Sockets\n\n**Always use the default tmux server.** Do NOT use `-S` custom sockets. The user needs to `tmux attach` easily without knowing obscure socket paths.\n\n## Session Naming\n\n**Convention:** `oc-${project}-${feature}` (e.g. `oc-knowhere-date-range-picker`, `oc-deck-auth-flow`)\n\n- `oc-` prefix = OpenClaw-managed, avoids collision with user sessions\n- Easy to find: `tmux ls | grep oc-`\n\n## Quickstart\n\n```bash\nSESSION=oc-myproject-feature\n\ntmux new-session -d -s \"$SESSION\" -c ~/projects/myproject\ntmux send-keys -t \"$SESSION\" 'claude --dangerously-skip-permissions' Enter\ntmux capture-pane -p -J -t \"$SESSION\" -S -200\n```\n\nAfter starting a session, tell the user:\n\n```\nTo monitor: tmux attach -t $SESSION\n```\n\n## Targeting panes and naming\n\n- Target format: `session:window.pane` (defaults to `:0.0`).\n- Keep names short; avoid spaces.\n- Inspect: `tmux list-sessions`, `tmux list-panes -a`.\n\n## Sending input safely\n\n- Prefer literal sends: `tmux send-keys -t target -l -- \"$cmd\"`.\n- Control keys: `tmux send-keys -t target C-c`.\n- For interactive TUI apps like Claude Code/Codex, **do not** append `Enter` in the same\n  `send-keys`. These apps may treat a fast text+Enter sequence as paste/multi-line input\n  and not submit. Send text and `Enter` as separate commands with a small delay:\n\n```bash\ntmux send-keys -t target -l -- \"$cmd\" && sleep 0.1 && tmux send-keys -t target Enter\n```\n\n## Watching output\n\n- Capture recent history: `tmux capture-pane -p -J -t target -S -200`.\n- Attaching is OK; detach with `Ctrl+b d`.\n\n## Spawning processes\n\n- For python REPLs, set `PYTHON_BASIC_REPL=1` (non-basic REPL breaks send-keys flows).\n\n## Orchestrating Coding Agents (Codex, Claude Code)\n\ntmux excels at running multiple coding agents in parallel:\n\n```bash\n# Create sessions in different worktrees\ntmux new-session -d -s oc-project-fix1 -c ~/projects/project-fix1\ntmux new-session -d -s oc-project-fix2 -c ~/projects/project-fix2\n\n# Launch agents\ntmux send-keys -t oc-project-fix1 'claude --dangerously-skip-permissions' Enter\ntmux send-keys -t oc-project-fix2 'codex --full-auto' Enter\n\n# Send a prompt (text + Enter separated by delay)\ntmux send-keys -t oc-project-fix1 -l -- \"Fix the date picker styling.\" && sleep 0.1 && tmux send-keys -t oc-project-fix1 Enter\n\n# Poll for completion (check if shell prompt returned)\nfor sess in oc-project-fix1 oc-project-fix2; do\n  if tmux capture-pane -p -t \"$sess\" -S -3 | grep -q \"❯\"; then\n    echo \"$sess: DONE\"\n  else\n    echo \"$sess: Running...\"\n  fi\ndone\n\n# Get full output\ntmux capture-pane -p -t oc-project-fix1 -S -500\n```\n\n**Tips:**\n\n- Use separate git worktrees for parallel fixes (no branch conflicts)\n- `bun install` / `pnpm install` first before running agents in fresh clones\n- Check for shell prompt (`❯` or `$`) to detect completion\n- Codex needs `--yolo` or `--full-auto` for non-interactive fixes\n\n## Cleanup\n\n- Kill a session: `tmux kill-session -t \"$SESSION\"`.\n- Kill all OpenClaw sessions: `tmux ls -F '#{session_name}' | grep '^oc-' | xargs -n1 tmux kill-session -t`.\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":1013,"installsAllTime":2,"installsCurrent":2,"stars":0,"versions":1},"createdAt":1772052092367,"updatedAt":1779077347834},"latestVersion":{"version":"1.0.0","createdAt":1772052092367,"changelog":"Auto-publish from CI","license":null},"metadata":{"setup":[],"os":["darwin","linux"],"systems":null},"owner":{"handle":"brennerspear","userId":"s17ebpr0c7y6bpmzatrjw5rdt583fggy","displayName":"BrennerSpear","image":"https://avatars.githubusercontent.com/u/12127609?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779960480884}}