Agent skill
ttt
Tmux Talk To - ส่งข้อความไปยัง tmux session อื่น ใช้สำหรับ: Multi-agent coordination, parallel execution, workflow automation
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/skills-contentsus-agentic-ai-paji
SKILL.md
Tmux Talk To (ttt)
เมื่อ user พิมพ์ /ttt ให้ส่งข้อความไปยัง tmux session อื่น
Usage
/ttt <session_name> <message>
/ttt <session_name> --esc <message> # ส่ง ESC ก่อนส่งข้อความ
/ttt --list # แสดง tmux sessions ที่มี
Step 1: Parse Arguments
# Extract session name and message from arguments
SESSION_NAME="$1"
MESSAGE="${@:2}"
# Check for --esc flag
ESC_MODE=false
if [[ "$2" == "--esc" ]]; then
ESC_MODE=true
MESSAGE="${@:3}"
fi
# Check for --list flag
if [[ "$1" == "--list" ]]; then
tmux list-sessions
exit 0
fi
Step 2: Validate Session
# Check if session exists
if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
echo "❌ Error: Session '$SESSION_NAME' not found"
echo ""
echo "Available sessions:"
tmux list-sessions
exit 1
fi
Step 3: Send Message
# If ESC mode, send ESC first
if [[ "$ESC_MODE" == "true" ]]; then
tmux send-keys -t "$SESSION_NAME" C-[
sleep 0.2
fi
# Send message with Enter
tmux send-keys -t "$SESSION_NAME" "$MESSAGE" C-m
echo "✅ ส่งข้อความไปยัง $SESSION_NAME แล้ว"
echo "Message: $MESSAGE"
Examples
Example 1: Send Simple Message
/ttt gemini1 "สวัสดี"
# Result: ส่ง "สวัสดี" ไปยัง gemini1 พร้อมกด Enter
Example 2: Send with ESC (if session stuck)
/ttt gemini1 --esc "สวัสดี"
# Result: กด ESC ก่อน แล้วส่ง "สวัสดี" ไปยัง gemini1
Example 3: List Sessions
/ttt --list
# Result: แสดง tmux sessions ทั้งหมด
Example 4: Complex Message
/ttt gemini1 "create workflow for Facebook login"
# Result: ส่งคำสั่งซับซ้อนไปยัง gemini1
Advanced Usage
Cross-Session Communication
ถ้าต้องการส่งข้อความไปหลาย sessions:
/ttt gemini1 "analyze workflow" && sleep 1 && /ttt claude1 "summarize results"
Capture Response (Manual)
# Send message
/ttt gemini1 "hello"
# Wait a bit, then capture response
tmux capture-pane -t gemini1 -p | tail -20
Important Notes
- C-m: Enter key in tmux
- C-[: ESC key - Use when shell stuck
- Sleep delay: Add
sleep 0.5between commands if needed - Session validation: Always check if session exists first
Troubleshooting
Problem: Message not appearing
Solution: Try with --esc flag to clear any stuck input
/ttt gemini1 --esc "your message"
Problem: Session not found
Solution: List available sessions first
/ttt --list
Problem: Complex message with quotes
Solution: Use single quotes for message
/ttt gemini1 'say "hello world"'
ARGUMENTS: $ARGS
Implementation
Run the following command:
SESSION_NAME="$1"
shift
# Handle flags
ESC_MODE=false
if [[ "$1" == "--list" ]]; then
echo "📋 Available tmux sessions:"
echo ""
tmux list-sessions
exit 0
fi
if [[ "$1" == "--esc" ]]; then
ESC_MODE=true
shift
fi
MESSAGE="$*"
# Validate session
if [[ -z "$SESSION_NAME" ]]; then
echo "❌ Error: No session name provided"
echo ""
echo "Usage: /ttt <session_name> <message>"
echo " /ttt --list"
exit 1
fi
if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
echo "❌ Error: Session '$SESSION_NAME' not found"
echo ""
echo "Available sessions:"
tmux list-sessions
exit 1
fi
# Send ESC if needed
if [[ "$ESC_MODE" == "true" ]]; then
tmux send-keys -t "$SESSION_NAME" C-[
sleep 0.2
echo "⎋ Sent ESC to $SESSION_NAME"
fi
# Send message
tmux send-keys -t "$SESSION_NAME" "$MESSAGE" C-m
echo "✅ ส่งข้อความไปยัง $SESSION_NAME แล้ว"
echo "📤 Message: $MESSAGE"
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?