运行后台进程时,需要在断开连接后仍能保持会话,这项技能提供了简单的命令,让你的 AI 助手能够创建、管理和监控 tmux 会话。
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "tmux". Create a tmux session called 'python-work' that runs python3
النتيجة المتوقعة:
- Session 'python-work' created successfully
- Window 0: python-work (started)
- To send commands: Use send-command to interact with the session
استخدام "tmux". List all active tmux sessions
النتيجة المتوقعة:
- Active tmux sessions:
- - python-work (1 window)
- - psql-dev (1 window)
- - logs-monitor (1 window)
استخدام "tmux". Send 'SELECT version();' to psql-dev and capture output
النتيجة المتوقعة:
- PostgreSQL 15.2 on x86_64-pc-linux-gnu
- (4 rows)
التدقيق الأمني
آمنThis is a legitimate tmux session management skill containing only metadata and documentation files. The static analysis produced severe false positives: all 'weak cryptographic algorithm' findings are spurious (no cryptography exists), and 'Ruby/shell backtick execution' findings incorrectly flag markdown code formatting delimiters as command execution. The skill provides local terminal session management via MCP protocol with no network calls, filesystem threats, or credential handling.
عوامل الخطر
🌐 الوصول إلى الشبكة (3)
⚙️ الأوامر الخارجية (55)
درجة الجودة
ماذا يمكنك بناءه
数据库会话管理
在后台会话中运行持久的数据库连接(如 psql 或 mysql),并按需执行查询
日志监控工作流
在 tmux 会话中持续跟踪日志文件,并捕获输出以检查错误或匹配模式
交互式 REPL 会话
为数据分析工作维护 Python 或 R REPL 会话,命令之间保持持久状态
جرّب هذه الموجهات
使用 tmux 技能列出所有活动的 tmux 会话
创建一个名为 'psql-dev' 的新 tmux 会话,运行 'psql -h localhost -U postgres mydb'
将命令 'SELECT COUNT(*) FROM users;' 发送到 'psql-dev' 会话,等待 'postgres=#' 提示符,然后捕获输出
终止 'psql-dev' 和 'logs-monitor' tmux 会话
أفضل الممارسات
- 使用带有前缀的描述性会话名称(如 'psql-'、'logs-' 或 'repl-')来组织多个会话
- 完成后务必终止会话以释放系统资源
- 使用 --wait 选项配合 capture-output 确保命令完成后再读取输出
تجنب
- 运行长期进程而不监控其输出或状态
- 使用通用名称(如 'test' 或 'session1')创建会话,导致冲突
- 忘记指定 --workdir,而会话需要访问特定项目文件