[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JM5XR997SYEBXDR86G524S":3,"skill-same:01M6JM5XR997SYEBXDR86G524S":100},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":13,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6JM5XR997SYEBXDR86G524S","tmux",null,"Remote control tmux sessions for interactive CLIs, background tasks, and services. Supports sub-tasks, long-running processes, and service management with session persistence and automatic cleanup.","superhealth\u002Fskills-hub","superhealth","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6292112?v=4","01M6JA6E7F21BYK5W3E4P270TT","01M6JA6EC0W8MPHKDJVBZDSEZ0",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002FSKILL.md",[],[5,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"session","for","with","remote","processes","long","service","control","background tasks","management","interactive","services","persistence","cleanup","tasks","sessions","2026-11-10 10:12:30",false,"---\nname: tmux\ndescription: \"Remote control tmux sessions for interactive CLIs, background tasks, and services. Supports sub-tasks, long-running processes, and service management with session persistence and automatic cleanup.\"\nlicense: MIT\n---\n\n# tmux Skill\n\nUse tmux as a programmable terminal multiplexer for interactive work, background tasks, and service management. Works on Linux and macOS with stock tmux; uses a private socket to avoid interfering with your personal tmux configuration.\n\n## Quickstart (isolated socket)\n\n```bash\n# Create a new session\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create my-task \"echo 'Hello World'\" task\n\n# List all sessions\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list\n\n# Capture output\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-my-task-20250107-123456\n\n# Kill a session\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill pi-task-my-task-20250107-123456\n```\n\n## Socket Convention\n\n- **Socket Directory**: `${TMPDIR:-\u002Ftmp}\u002Fpi-tmux-sockets`\n- **Default Socket**: `\u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock`\n- **Environment Variable**: `PI_TMUX_SOCKET_DIR` (optional override)\n\nAll Agent sessions use a private socket to avoid conflicts with your personal tmux configuration.\n\n## Session Naming\n\nSessions are named using the pattern: `pi-{category}-{name}-{timestamp}`\n\n- **Categories**:\n  - `task`: Temporary sub-tasks (compilation, testing)\n  - `service`: Long-running services (dev servers, databases)\n  - `agent`: Agent-specific tasks (training, data processing)\n\n- **Examples**:\n  - `pi-task-compile-20250107-123456`\n  - `pi-service-dev-server-20250107-123456`\n  - `pi-agent-training-20250107-123456`\n\n## CLI Commands\n\n### Create Session\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create \u003Cname> \u003Ccommand> [category]\n```\n\nCreates a new tmux session and automatically prints the monitoring command.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create compile \"make clean && make all\" task\n```\n\n### List Sessions\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list [filter]\n```\n\nLists all sessions with status and last activity time.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list service\n```\n\n### Session Status\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts status \u003Cid>\n```\n\nShows detailed information about a session.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts status pi-task-compile-20250107-123456\n```\n\n### Send Keys\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts send \u003Cid> \u003Ckeys>\n```\n\nSends keystrokes to a session. Uses literal mode to avoid shell escaping.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts send pi-task-python-20250107-123456 \"print('Hello')\"\n```\n\n### Capture Output\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture \u003Cid> [lines]\n```\n\nCaptures pane output (default: 200 lines).\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-compile-20250107-123456 500\n```\n\n### Kill Session\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill \u003Cid>\n```\n\nTerminates a tmux session.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill pi-task-compile-20250107-123456\n```\n\n### Cleanup Old Sessions\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup [hours]\n```\n\nRemoves inactive sessions older than the specified age (default: 24 hours).\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup 48\n```\n\n### Attach to Session\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts attach \u003Cid>\n```\n\nPrints the command to attach to a session interactively.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts attach pi-task-python-20250107-123456\n# Output: tmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock attach -t pi-task-python-20250107-123456\n```\n\n### Sync Sessions\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts sync\n```\n\nSynchronizes session status with tmux actual state.\n\n## Session Persistence\n\nSession information is stored in `${TMPDIR:-\u002Ftmp}\u002Fpi-tmux-sessions.json`. This allows:\n- Cross-session recovery\n- State tracking across Agent restarts\n- Automatic cleanup of stale sessions\n\n**Storage Format**:\n```json\n{\n  \"sessions\": {\n    \"pi-task-compile-20250107-123456\": {\n      \"id\": \"pi-task-compile-20250107-123456\",\n      \"name\": \"compile\",\n      \"category\": \"task\",\n      \"socket\": \"\u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock\",\n      \"target\": \"pi-task-compile-20250107-123456:0.0\",\n      \"command\": \"make clean && make all\",\n      \"status\": \"running\",\n      \"createdAt\": \"2025-01-07T12:34:56Z\",\n      \"lastActivityAt\": \"2025-01-07T12:35:00Z\"\n    }\n  },\n  \"lastSync\": \"2025-01-07T12:35:00Z\"\n}\n```\n\n## Use Cases\n\n### Sub-task Execution\nExecute temporary tasks that require monitoring:\n\n```bash\n# Start compilation\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create compile \"make all\" task\n\n# Wait for completion (in script)\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-compile-20250107-123456 | grep \"Build successful\"\n\n# Get result\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-compile-20250107-123456\n\n# Cleanup\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill pi-task-compile-20250107-123456\n```\n\n### Long-running Tasks\nRun tasks in the background and check progress later:\n\n```bash\n# Start training\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create training \"python train.py --epochs 100\" task\n\n# Check progress later\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-training-20250107-123456\n```\n\n### Service Management\nStart development servers or services:\n\n```bash\n# Start dev server\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create dev-server \"npm run dev\" service\n\n# Monitor logs\ntmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock attach -t pi-service-dev-server-20250107-123456\n\n# Stop when done\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill pi-service-dev-server-20250107-123456\n```\n\n### Interactive Tools\nUse interactive tools like Python REPL, gdb, or databases:\n\n```bash\n# Python REPL (always use PYTHON_BASIC_REPL=1)\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create python \"PYTHON_BASIC_REPL=1 python3 -q\" task\n\n# Send commands\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts send pi-task-python-20250107-123456 \"print('Hello')\"\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts send pi-task-python-20250107-123456 \"2 + 2\"\n```\n\n## Status Detection\n\nSessions have three possible states:\n- **running**: Process is active with recent output\n- **idle**: Process exists but no recent output\n- **exited**: Process has terminated\n\nStatus is automatically synced with tmux actual state.\n\n## Automatic Cleanup\n\nBy default, sessions inactive for more than 24 hours are automatically cleaned up. You can:\n\n- Trigger manual cleanup:\n  ```bash\n  bun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup [hours]\n  ```\n\n- Disable auto-cleanup in code:\n  ```typescript\n  const tmux = new TmuxManager({ autoCleanup: false });\n  ```\n\n## Helper Scripts\n\n### wait-for-text.sh\nPolls a pane for a regex pattern with timeout.\n\n```bash\n.\u002Fscripts\u002Fwait-for-text.sh -t session:0.0 -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000]\n```\n\n- `-t\u002F--target`: Pane target (required)\n- `-p\u002F--pattern`: Regex to match (required); add `-F` for fixed string\n- `-T`: Timeout in seconds (default: 15)\n- `-i`: Poll interval in seconds (default: 0.5)\n- `-l`: History lines to search (default: 1000)\n\n### find-sessions.sh\nLists tmux sessions with metadata.\n\n```bash\n.\u002Fscripts\u002Ffind-sessions.sh -S \"$SOCKET\"\n.\u002Fscripts\u002Ffind-sessions.sh --all  # Scan all sockets\n```\n\n## Examples\n\nSee the `examples\u002F` directory for complete examples:\n- `python-repl.ts`: Interactive Python REPL\n- `long-task.ts`: Long-running task with progress\n- `start-service.ts`: Service management\n\n## TypeScript API\n\nYou can also use the TypeScript API directly:\n\n```typescript\nimport { TmuxManager } from \"~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts\";\n\nconst tmux = new TmuxManager();\n\n\u002F\u002F Create session\nconst session = await tmux.createSession('compile', 'make all', 'task');\n\n\u002F\u002F Wait for output\nconst success = await tmux.waitForText(session.target, 'Build successful', { timeout: 60 });\n\n\u002F\u002F Capture output\nconst output = await tmux.capturePane(session.target, 200);\n\n\u002F\u002F Cleanup\nawait tmux.killSession(session.id);\n```\n\n## Monitoring Sessions\n\nAfter creating a session, ALWAYS tell the user how to monitor it:\n\n```\nTo monitor this session yourself:\n  tmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock attach -t pi-task-compile-20250107-123456\n\nOr to capture the output once:\n  tmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock capture-pane -p -J -t pi-task-compile-20250107-123456:0.0 -S -200\n```\n\nThis must be printed immediately after session creation and at the end of the tool loop.\n\n## Security Considerations\n\n- Uses private socket path to avoid conflicts\n- Sends keys in literal mode (`-l`) to prevent shell injection\n- Checks tmux actual state before cleanup\n- Requires explicit confirmation for destructive operations\n\n## Troubleshooting\n\n### Session not found\nRun sync to update session state:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts sync\n```\n\n### Cannot attach to session\nEnsure tmux is installed and the socket path is correct:\n```bash\ntmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock attach -t \u003Csession-id>\n```\n\n### Sessions not cleaning up\nManually trigger cleanup:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup\n```\n\n### Permission denied on socket\nCheck socket directory permissions:\n```bash\nls -la \u002Ftmp\u002Fpi-tmux-sockets\u002F\n```\n\n## Requirements\n\n- tmux (Linux\u002FmacOS)\n- Bun runtime\n- Bash (for helper scripts)","# tmux Skill\n\nUse tmux as a programmable terminal multiplexer for interactive work, background tasks, and service management. Works on Linux and macOS with stock tmux; uses a private socket to avoid interfering with your personal tmux configuration.\n\n## Quickstart (isolated socket)\n\n```bash\n# Create a new session\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create my-task \"echo 'Hello World'\" task\n\n# List all sessions\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list\n\n# Capture output\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-my-task-20250107-123456\n\n# Kill a session\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill pi-task-my-task-20250107-123456\n```\n\n## Socket Convention\n\n- **Socket Directory**: `${TMPDIR:-\u002Ftmp}\u002Fpi-tmux-sockets`\n- **Default Socket**: `\u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock`\n- **Environment Variable**: `PI_TMUX_SOCKET_DIR` (optional override)\n\nAll Agent sessions use a private socket to avoid conflicts with your personal tmux configuration.\n\n## Session Naming\n\nSessions are named using the pattern: `pi-{category}-{name}-{timestamp}`\n\n- **Categories**:\n  - `task`: Temporary sub-tasks (compilation, testing)\n  - `service`: Long-running services (dev servers, databases)\n  - `agent`: Agent-specific tasks (training, data processing)\n\n- **Examples**:\n  - `pi-task-compile-20250107-123456`\n  - `pi-service-dev-server-20250107-123456`\n  - `pi-agent-training-20250107-123456`\n\n## CLI Commands\n\n### Create Session\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create \u003Cname> \u003Ccommand> [category]\n```\n\nCreates a new tmux session and automatically prints the monitoring command.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create compile \"make clean && make all\" task\n```\n\n### List Sessions\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list [filter]\n```\n\nLists all sessions with status and last activity time.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list service\n```\n\n### Session Status\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts status \u003Cid>\n```\n\nShows detailed information about a session.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts status pi-task-compile-20250107-123456\n```\n\n### Send Keys\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts send \u003Cid> \u003Ckeys>\n```\n\nSends keystrokes to a session. Uses literal mode to avoid shell escaping.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts send pi-task-python-20250107-123456 \"print('Hello')\"\n```\n\n### Capture Output\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture \u003Cid> [lines]\n```\n\nCaptures pane output (default: 200 lines).\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-compile-20250107-123456 500\n```\n\n### Kill Session\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill \u003Cid>\n```\n\nTerminates a tmux session.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill pi-task-compile-20250107-123456\n```\n\n### Cleanup Old Sessions\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup [hours]\n```\n\nRemoves inactive sessions older than the specified age (default: 24 hours).\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup 48\n```\n\n### Attach to Session\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts attach \u003Cid>\n```\n\nPrints the command to attach to a session interactively.\n\n**Example**:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts attach pi-task-python-20250107-123456\n# Output: tmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock attach -t pi-task-python-20250107-123456\n```\n\n### Sync Sessions\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts sync\n```\n\nSynchronizes session status with tmux actual state.\n\n## Session Persistence\n\nSession information is stored in `${TMPDIR:-\u002Ftmp}\u002Fpi-tmux-sessions.json`. This allows:\n- Cross-session recovery\n- State tracking across Agent restarts\n- Automatic cleanup of stale sessions\n\n**Storage Format**:\n```json\n{\n  \"sessions\": {\n    \"pi-task-compile-20250107-123456\": {\n      \"id\": \"pi-task-compile-20250107-123456\",\n      \"name\": \"compile\",\n      \"category\": \"task\",\n      \"socket\": \"\u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock\",\n      \"target\": \"pi-task-compile-20250107-123456:0.0\",\n      \"command\": \"make clean && make all\",\n      \"status\": \"running\",\n      \"createdAt\": \"2025-01-07T12:34:56Z\",\n      \"lastActivityAt\": \"2025-01-07T12:35:00Z\"\n    }\n  },\n  \"lastSync\": \"2025-01-07T12:35:00Z\"\n}\n```\n\n## Use Cases\n\n### Sub-task Execution\nExecute temporary tasks that require monitoring:\n\n```bash\n# Start compilation\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create compile \"make all\" task\n\n# Wait for completion (in script)\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-compile-20250107-123456 | grep \"Build successful\"\n\n# Get result\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-compile-20250107-123456\n\n# Cleanup\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill pi-task-compile-20250107-123456\n```\n\n### Long-running Tasks\nRun tasks in the background and check progress later:\n\n```bash\n# Start training\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create training \"python train.py --epochs 100\" task\n\n# Check progress later\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts list\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts capture pi-task-training-20250107-123456\n```\n\n### Service Management\nStart development servers or services:\n\n```bash\n# Start dev server\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create dev-server \"npm run dev\" service\n\n# Monitor logs\ntmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock attach -t pi-service-dev-server-20250107-123456\n\n# Stop when done\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts kill pi-service-dev-server-20250107-123456\n```\n\n### Interactive Tools\nUse interactive tools like Python REPL, gdb, or databases:\n\n```bash\n# Python REPL (always use PYTHON_BASIC_REPL=1)\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts create python \"PYTHON_BASIC_REPL=1 python3 -q\" task\n\n# Send commands\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts send pi-task-python-20250107-123456 \"print('Hello')\"\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts send pi-task-python-20250107-123456 \"2 + 2\"\n```\n\n## Status Detection\n\nSessions have three possible states:\n- **running**: Process is active with recent output\n- **idle**: Process exists but no recent output\n- **exited**: Process has terminated\n\nStatus is automatically synced with tmux actual state.\n\n## Automatic Cleanup\n\nBy default, sessions inactive for more than 24 hours are automatically cleaned up. You can:\n\n- Trigger manual cleanup:\n  ```bash\n  bun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup [hours]\n  ```\n\n- Disable auto-cleanup in code:\n  ```typescript\n  const tmux = new TmuxManager({ autoCleanup: false });\n  ```\n\n## Helper Scripts\n\n### wait-for-text.sh\nPolls a pane for a regex pattern with timeout.\n\n```bash\n.\u002Fscripts\u002Fwait-for-text.sh -t session:0.0 -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000]\n```\n\n- `-t\u002F--target`: Pane target (required)\n- `-p\u002F--pattern`: Regex to match (required); add `-F` for fixed string\n- `-T`: Timeout in seconds (default: 15)\n- `-i`: Poll interval in seconds (default: 0.5)\n- `-l`: History lines to search (default: 1000)\n\n### find-sessions.sh\nLists tmux sessions with metadata.\n\n```bash\n.\u002Fscripts\u002Ffind-sessions.sh -S \"$SOCKET\"\n.\u002Fscripts\u002Ffind-sessions.sh --all  # Scan all sockets\n```\n\n## Examples\n\nSee the `examples\u002F` directory for complete examples:\n- `python-repl.ts`: Interactive Python REPL\n- `long-task.ts`: Long-running task with progress\n- `start-service.ts`: Service management\n\n## TypeScript API\n\nYou can also use the TypeScript API directly:\n\n```typescript\nimport { TmuxManager } from \"~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts\";\n\nconst tmux = new TmuxManager();\n\n\u002F\u002F Create session\nconst session = await tmux.createSession('compile', 'make all', 'task');\n\n\u002F\u002F Wait for output\nconst success = await tmux.waitForText(session.target, 'Build successful', { timeout: 60 });\n\n\u002F\u002F Capture output\nconst output = await tmux.capturePane(session.target, 200);\n\n\u002F\u002F Cleanup\nawait tmux.killSession(session.id);\n```\n\n## Monitoring Sessions\n\nAfter creating a session, ALWAYS tell the user how to monitor it:\n\n```\nTo monitor this session yourself:\n  tmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock attach -t pi-task-compile-20250107-123456\n\nOr to capture the output once:\n  tmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock capture-pane -p -J -t pi-task-compile-20250107-123456:0.0 -S -200\n```\n\nThis must be printed immediately after session creation and at the end of the tool loop.\n\n## Security Considerations\n\n- Uses private socket path to avoid conflicts\n- Sends keys in literal mode (`-l`) to prevent shell injection\n- Checks tmux actual state before cleanup\n- Requires explicit confirmation for destructive operations\n\n## Troubleshooting\n\n### Session not found\nRun sync to update session state:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts sync\n```\n\n### Cannot attach to session\nEnsure tmux is installed and the socket path is correct:\n```bash\ntmux -S \u002Ftmp\u002Fpi-tmux-sockets\u002Fpi.sock attach -t \u003Csession-id>\n```\n\n### Sessions not cleaning up\nManually trigger cleanup:\n```bash\nbun ~\u002F.pi\u002Fagent\u002Fskills\u002Ftmux\u002Flib.ts cleanup\n```\n\n### Permission denied on socket\nCheck socket directory permissions:\n```bash\nls -la \u002Ftmp\u002Fpi-tmux-sockets\u002F\n```\n\n## Requirements\n\n- tmux (Linux\u002FmacOS)\n- Bun runtime\n- Bash (for helper scripts)",{"name":5,"license":14,"description":7},"master","08cc2532077058aa50e6e18f54695bc256c88152","skills\u002Fdwsy\u002Ftmux","https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub","https:\u002F\u002Fgithub.com\u002Fsuperhealth","java engineer","2026-04-06 22:07:23",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add superhealth\u002Fskills-hub --skill tmux",{"tool":52,"command":53},"bunx","bunx skills add superhealth\u002Fskills-hub --skill tmux",{"tool":55,"command":56},"pnpm","pnpm dlx skills add superhealth\u002Fskills-hub --skill tmux","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002FSKILL.md",true,[60,66,70,74,78,82,86,92,96],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"examples\u002Flong-task.ts","SCRIPT","脚本",1161,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Fexamples\u002Flong-task.ts",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"examples\u002Fpython-repl.ts",1116,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Fexamples\u002Fpython-repl.ts",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"examples\u002Fstart-service.ts",1240,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Fexamples\u002Fstart-service.ts",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"lib.ts",12721,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Flib.ts",{"path":79,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":80,"sourceHtmlUrl":81},"scripts\u002Ffind-sessions.sh",2939,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Fscripts\u002Ffind-sessions.sh",{"path":83,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":84,"sourceHtmlUrl":85},"scripts\u002Fwait-for-text.sh",2139,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Fscripts\u002Fwait-for-text.sh",{"path":87,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":90,"sourceHtmlUrl":91},"skill-report.json","REFERENCE","参考文档",10682,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Fskill-report.json",{"path":93,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":94,"sourceHtmlUrl":95},"tsconfig.json",345,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Ftsconfig.json",{"path":97,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":98,"sourceHtmlUrl":99},"types\u002Findex.ts",587,"https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fdwsy\u002Ftmux\u002Ftypes\u002Findex.ts",[101,132,159,172,186,210],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":112,"publishedAt":34},"01M6MC9F3WHV8S8FZ2W4TRB0FE","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fzhanlincui\u002Fvercel-react-best-practices\u002FSKILL.md",[107],{"categoryNo":108,"categoryName":109,"taxonomyType":110,"taxonomyTypeDesc":111},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[113,114,115,116,117,118,119,120,121,122,123,124,125,126,32,127,128,129,130,131],"react","vercel react best practices","best practices","vercel","react best practices","data fetching","code","triggers","pages","next","patterns","refactoring","data","Optimization","guidelines","react components","components","performance","writing",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":142,"publishedAt":34},"01M6MB8KWE1Q5A5KERR7RFTQWP","vue-testing-best-practices","Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.","https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fvuejs-ai\u002Fvue-testing-best-practices\u002FSKILL.md",[138,141],{"categoryNo":139,"categoryName":140,"taxonomyType":110,"taxonomyTypeDesc":111},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":108,"categoryName":109,"taxonomyType":110,"taxonomyTypeDesc":111},[143,144,145,115,146,147,148,149,150,151,152,123,153,154,19,155,156,157,158],"vue testing best practices","testing best practices","vue","testing","testing patterns","js","e2e","vitest","use","component","test","mocking","utils","e2e testing","github","playwright",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":166,"publishedAt":34},"01M6MB8GK06M6GA4KVYNDV1BZP","vue-router-best-practices","Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.","https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fvuejs-ai\u002Fvue-router-best-practices\u002FSKILL.md",[165],{"categoryNo":108,"categoryName":109,"taxonomyType":110,"taxonomyTypeDesc":111},[115,145,167,168,169,123,170,171,152,157],"router","vue router best practices","route","navigation","lifecycle",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":179,"publishedAt":34},"01M6MB8DQF21TZMQ9XC3745ERW","vue-pinia-best-practices","Pinia stores, state management patterns, store setup, and reactivity with stores.","https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fvuejs-ai\u002Fvue-pinia-best-practices\u002FSKILL.md",[178],{"categoryNo":108,"categoryName":109,"taxonomyType":110,"taxonomyTypeDesc":111},[180,181,145,115,20,182,123,27,183,184,185,157],"vue pinia best practices","pinia","store","state","state management","setup",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":190,"categories":191,"keywords":201,"publishedAt":34},"01M6MB8A7MC08747J9TV4GWQ9A","vue-options-api-best-practices","Vue 3 Options API style (data(), methods, this context). Each reference shows Options API solution only.","https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fvuejs-ai\u002Fvue-options-api-best-practices\u002FSKILL.md",[192,193,196],{"categoryNo":108,"categoryName":109,"taxonomyType":110,"taxonomyTypeDesc":111},{"categoryNo":194,"categoryName":195,"taxonomyType":110,"taxonomyTypeDesc":111},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":197,"categoryName":198,"taxonomyType":199,"taxonomyTypeDesc":200},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[145,202,203,204,115,205,206,207,208,125,157,209],"options","vue options api best practices","api","methods","reference","only","context","style",{"skillNo":211,"name":212,"nameZh":6,"description":213,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":214,"categories":215,"keywords":217,"publishedAt":34},"01M6MB85ZTQC24Q04X49MM4YXN","vue-development-guides","A collection of best practices and tips for developing applications using Vue.js. This skill MUST be apply when developing, refactoring or reviewing Vue.js or Nuxt projects.","https:\u002F\u002Fgithub.com\u002Fsuperhealth\u002Fskills-hub\u002Fblob\u002Fmaster\u002Fskills\u002Fvuejs-ai\u002Fvue-development-guides\u002FSKILL.md",[216],{"categoryNo":108,"categoryName":109,"taxonomyType":110,"taxonomyTypeDesc":111},[218,145,219,220,157,221,222,19,223,224,225,148,124,226,227,115],"development","guides","vue development guides","tips","apply","project","nuxt","projects","collection","applications"]