surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
When Claude Code runs in a different context (container, namespace, etc), tmux may resolve to a different socket than the user's terminal. Using -L default explicitly targets the default socket name, fixing the issue where Claude sees different tmux sessions than the user.
| Mplugins/plugin-dev/skills/plugin-settings/SKILL.md |
| Mplugins/plugin-dev/skills/plugin-settings/references/real-world-examples.md |
| @@ -230,8 +230,8 @@ | ||
| 230 | 230 | AGENT_NAME=$(echo "$FRONTMATTER" | grep '^agent_name:' | sed 's/agent_name: *//') |
| 231 | 231 | COORDINATOR=$(echo "$FRONTMATTER" | grep '^coordinator_session:' | sed 's/coordinator_session: *//') |
| 232 | 232 | |
| 233 | -# Send notification to coordinator | |
| 234 | -tmux send-keys -t "$COORDINATOR" "Agent $AGENT_NAME completed task" Enter | |
| 233 | +# Send notification to coordinator (use -L default to ensure correct socket) | |
| 234 | +tmux -L default send-keys -t "$COORDINATOR" "Agent $AGENT_NAME completed task" Enter | |
| 235 | 235 | ``` |
| 236 | 236 | |
| 237 | 237 | ### Pattern 3: Configuration-Driven Behavior |
| @@ -76,10 +76,10 @@ | ||
| 76 | 76 | # Send notification to coordinator |
| 77 | 77 | NOTIFICATION="🤖 Agent ${AGENT_NAME} (Task ${TASK_NUMBER}, PR #${PR_NUMBER}) is idle." |
| 78 | 78 | |
| 79 | -if tmux has-session -t "$COORDINATOR_SESSION" 2>/dev/null; then | |
| 80 | - tmux send-keys -t "$COORDINATOR_SESSION" "$NOTIFICATION" Enter | |
| 79 | +if tmux -L default has-session -t "$COORDINATOR_SESSION" 2>/dev/null; then | |
| 80 | + tmux -L default send-keys -t "$COORDINATOR_SESSION" "$NOTIFICATION" Enter | |
| 81 | 81 | sleep 0.5 |
| 82 | - tmux send-keys -t "$COORDINATOR_SESSION" Enter | |
| 82 | + tmux -L default send-keys -t "$COORDINATOR_SESSION" Enter | |
| 83 | 83 | fi |
| 84 | 84 | |
| 85 | 85 | exit 0 |