# Wmux Detect

> Wmux Detect is an Agent Skill for agent building published in the amirlehmam/wmux repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Detect if wmux terminal multiplexer is running. Used internally by orchestrate skill to decide between wmux multi-pane mode and degraded subagent mode.

- Skill name: `wmux-detect`
- Category: [Agent Building](https://www.openparable.com/skill/agent-building/1)
- Source: https://github.com/amirlehmam/wmux/blob/HEAD/resources/wmux-orchestrator/skills/wmux-detect/SKILL.md
- Repository: amirlehmam/wmux (278 GitHub stars when collected)

## SKILL.md

# wmux Detection

First, resolve the plugin root (not available as env var in main session):

```bash
PLUGIN_ROOT=$(find "$HOME/.claude/plugins/cache/wmux-orchestrator" -name "plugin.json" -path "*/.claude-plugin/*" 2>/dev/null | sort -V | tail -1 | sed 's|/.claude-plugin/plugin.json||')
```

Run the detection script to check if wmux is available:

```bash
bash "$PLUGIN_ROOT/scripts/detect-wmux.sh"
```

**If output is "available":**
- wmux is running and the named pipe is accessible
- The orchestrator can use `wmux split`, `wmux agent spawn`, `wmux markdown set` etc.
- Full multi-pane visual experience is available

Detection works even when `wmux` isn't on PATH: shells spawned by wmux always carry `$WMUX_CLI`
(the path to the CLI script), and the detection script falls back to running it via `node` when the
bare command isn't found. The same fallback applies to every plugin script that calls `wmux`.

**If output is "unavailable":**
- wmux is not running or not installed
- Fall back to Claude Code's native `Agent` tool for parallel workers
- No visual dashboard — use text summaries in the terminal instead
- Log: "wmux not detected. Running in degraded mode — agents will use Claude Code's native subagent system. Install wmux for the full multi-pane experience: https://wmux.org"

Store the detection result so other skills can check it without re-running:

```bash
export WMUX_AVAILABLE=$( bash "$PLUGIN_ROOT/scripts/detect-wmux.sh" 2>/dev/null && echo "true" || echo "false" )
```

**ENFORCEMENT:**
- When `WMUX_AVAILABLE=true`: ALL agents MUST be spawned via `wmux agent spawn`. Do NOT use Claude Code's `Agent` tool. The Agent tool creates invisible subagents — the user chose wmux specifically to SEE agents in panes.
- When `WMUX_AVAILABLE=false`: Use Claude Code's `Agent` tool with `subagent_type: "wmux-orchestrator:wmux-worker"`.
- Never mix modes within an orchestration.

---

Source: https://www.openparable.com/skill/agent-building/wmux-detect (OpenParable). Cite the canonical URL above.
