Summary
cmux-claude-wrapper allowlists Claude Code subcommands in claude_builtin_command_name():
agents|auth|auto-mode|config|api-key|daemon|doctor|install|mcp|
experimental-next|plugin|plugins|project|rc|remote-control|setup-token|
ultrareview|update|upgrade
Claude Code 2.1.267 also ships these subcommands, none of which are on the list:
attach <id>
logs <id>
stop|kill <id>
rm <id>
respawn [id]
gateway
import
Because they miss the allowlist, should_inject_claude_hooks returns 0, the wrapper injects a fresh --session-id plus its hooks, and the real binary receives the subcommand as a prompt.
Repro
Inside a cmux terminal, with a background session running:
claude --bg # prints e.g. 8b4d264b
claude attach 8b4d264b
Expected: the background session opens in this terminal.
Actual: a brand-new interactive session starts, with the opening prompt attach 8b4d264b. The background session is never touched.
Workaround
Bypass the shim by calling the binary directly:
~/.local/bin/claude attach 8b4d264b
This works as expected, which confirms the wrapper is the only thing in the way.
Suggested fix
Add attach|logs|stop|kill|rm|respawn|gateway|import to claude_builtin_command_name() so they take the exec_real_claude_passthrough path, same as agents does today.
Related: #4005 (same class of problem for claude agents).
Environment
- cmux
/Applications/cmux.app, wrapper at Contents/Resources/bin/cmux-claude-wrapper
- Claude Code 2.1.267, arm64 native binary at
~/.local/bin/claude
- macOS (Darwin 25.5.0), zsh
Summary
cmux-claude-wrapperallowlists Claude Code subcommands inclaude_builtin_command_name():Claude Code 2.1.267 also ships these subcommands, none of which are on the list:
attach <id>logs <id>stop|kill <id>rm <id>respawn [id]gatewayimportBecause they miss the allowlist,
should_inject_claude_hooksreturns 0, the wrapper injects a fresh--session-idplus its hooks, and the real binary receives the subcommand as a prompt.Repro
Inside a cmux terminal, with a background session running:
Expected: the background session opens in this terminal.
Actual: a brand-new interactive session starts, with the opening prompt
attach 8b4d264b. The background session is never touched.Workaround
Bypass the shim by calling the binary directly:
This works as expected, which confirms the wrapper is the only thing in the way.
Suggested fix
Add
attach|logs|stop|kill|rm|respawn|gateway|importtoclaude_builtin_command_name()so they take theexec_real_claude_passthroughpath, same asagentsdoes today.Related: #4005 (same class of problem for
claude agents).Environment
/Applications/cmux.app, wrapper atContents/Resources/bin/cmux-claude-wrapper~/.local/bin/claude