From claude-commands
Verifies TUI-only Claude Code features (slash commands, dialogs, pickers, status indicators) by spawning an interactive cmux session instead of using non-interactive --print which always returns false negatives.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:test-tui-claude-feature-via-cmuxWhen to use
Use when the user asks 'does Claude Code feature X work', 'verify /feature works', 'test the slash command', or any verification question about a Claude Code TUI-only feature. Also use proactively when about to write `claude --print "/<feature>"` to test anything — that's the wrong test. Trigger phrases: 'verify /', 'test /', 'check that /', 'is /feature available', 'does the advisor work', 'does the model picker work', 'is the slash command working'.
This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill any time a verification question is about a Claude Code feature
--printUse this skill any time a verification question is about a Claude Code feature
that is implemented in the TUI (slash commands, dialogs, pickers, status bar
indicators, settings menus). The most common failure mode is treating
claude --print "/feature" as a test — it isn't, and the resulting
"isn't available in this environment" error leads to wasted time reading
minified binary strings chasing phantom gates.
Trigger phrases (load this skill when you see any of these):
Do NOT use this skill for:
--print "what model are you?" works)--print is fine)claude --print is non-interactive mode. Slash commands render inside the
Ink TUI as menus, dialogs, or pickers — they have no --print representation.
The binary's response to any TUI slash command in --print mode is always:
/<feature> isn't available in this environment.
That error specifically means "I cannot show you this in non-interactive mode," not "this feature is broken." Treating it as a feature-gate failure is the mistake this skill exists to prevent.
# 1. Spawn a fresh Claude Code workspace in cmux
export CMUX_SOCKET_PATH=/private/tmp/cmux-debug-may-18.sock
WS_OUT=$(cmux new-workspace --cwd "$PWD" --command "claude")
WS=$(echo "$WS_OUT" | grep -oE 'workspace:[0-9]+' | head -1)
# 2. Find the auto-created surface
sleep 2
SURF=$(cmux list-pane-surfaces --workspace "$WS" 2>/dev/null \
| grep -oE 'surface:[0-9]+' | head -1)
# 3. Wait for Claude to be ready (look for the `❯` prompt in screen text)
cmux read-screen --workspace "$WS" --surface "$SURF" --scrollback --lines 30
# 4. Send the slash command + press Enter
cmux send --workspace "$WS" --surface "$SURF" "/advisor"
cmux send-key --workspace "$WS" --surface "$SURF" enter
# 5. Read the result (dialog, picker, error message, etc.)
sleep 2
cmux read-screen --workspace "$WS" --surface "$SURF" --scrollback --lines 50
# 6. Clean up — Esc out + close workspace
cmux send-key --workspace "$WS" --surface "$SURF" escape
cmux close-workspace --workspace "$WS"
For multi-step TUI flows (multi-screen dialogs, follow-up pickers), repeat
steps 4-5 with appropriate send-key calls between (arrow keys, enter,
etc.). See the cmux skill (~/.hermes_prod/skills/cmux/SKILL.md) for the
full key set.
scripts/test-tui-feature.shA wrapper script that takes the slash command as an argument and runs the full spawn-send-read-cleanup cycle:
~/.claude/skills/test-tui-claude-feature-via-cmux/scripts/test-tui-feature.sh /advisor
~/.claude/skills/test-tui-claude-feature-via-cmux/scripts/test-tui-feature.sh /config
~/.claude/skills/test-tui-claude-feature-via-cmux/scripts/test-tui-feature.sh /model
The script:
claude❯ prompt (polls read-screen with a 30s timeout)isFirstPartyApiBackend,
xr(), VW(), oct(), isFirstPartyAnthropicBaseUrl)settings.json (e.g. _CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL=1)
that don't change behavior--print is fine for:
claude --print "what model are you?"Rule of thumb: if the question is "does this feature work in the
TUI" or "does this slash command do X" → use cmux. If the question is
"can the model do X" or "does the API return Y" → --print is fine.
| Symptom | Likely real cause | Test that proves it |
|---|---|---|
--print "/advisor" returns "isn't available" | Normal non-interactive behavior | Open in cmux, see picker |
--print "/advisor" returns 401 / auth error | OAuth or keychain issue | claude --print "what model are you?" — if that works, auth is fine |
claude in TUI never reaches ❯ prompt | Workspace trust, settings issue | cmux read-screen shows what's actually on screen |
| Slash command opens but shows wrong content | Real bug — model/state issue | Reproduce in cmux, check the actual dialog |
Test target: advisorModel: "claude-opus-4-8" in ~/.claude/settings.json
— was the advisor actually using Opus 4.8?
claude --print "/advisor" (with and without various ANTHROPIC_BASE_URL
settings) → always returned "isn't available in this environment"cmux send "/advisor" + enter in workspace:30 surface:65 → opened the
picker dialog showing 1. Fable 5 / ❯ 2. Opus 4.8 ✔ / 3. Sonnet 4.6 / 4. No advisor✔ on Opus 4.8 = current selection = the advisorModel setting was
being read correctly. Feature was working the whole time.The user had to push back twice ("are you opening claude code itself and
typing /advisor?", "use cmux stop being lazy") before the correct test
was performed.
~/.hermes_prod/skills/cmux/SKILL.md~/.claude/projects/-Users-jleechan--hermes-prod/memory/bestpractice_2026-06-23_test-tui-features-via-cmux.md~/llm_wiki/wiki/sources/bestpractice-2026-06-23-test-tui-features-via-cmux.md~/llm_wiki/wiki/concepts/TUISlashCommandTesting.mdjleechan-37uv (closed)~/roadmap/learnings-2026-06.md entry dated 2026-06-23npx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsOrchestrates terminal panes, spawns Claude/Codex sub-agents, sends keys between surfaces, reads pane output, and manages browser/markdown panes via cmux CLI. Replaces plain bash for parallel multi-pane workflows.
Communicates with a user's live Claude Code session via the local Claude Channel CLI, using MCP tools to check channel status and send requests.
Debug interactive CLIs, REPLs, TUIs, watchers, and long-running terminal processes using tmux to preserve live state, send controlled input, and capture evidence. Use when commands hang, wait for input, or behave differently in a real terminal.