Fix Claude remote-control wrapper passthrough in cmux

Closed
AU
1mo ago
+200-6

Summary

  • add regression coverage for Claude wrapper passthrough when invoking claude rc / claude remote-control
  • stop cmux from injecting --session-id / --settings into passthrough Claude subcommands after leading global options
  • clear nested CLAUDECODE markers before passthrough execs so cmux-launched sessions stay isolated

Verification

  • built and launched ./scripts/reload.sh --tag issue-1782-claude-rc
  • verified the tagged app bundle includes the updated Resources/bin/claude wrapper
  • verified the tagged bundle's wrapper reaches Claude's own remote-control path instead of failing with Unknown argument: <uuid>

Fixes #1782


Summary by cubic

Hardens the claude wrapper in cmux to correctly passthrough rc/remote-control and other management commands without injecting session/settings flags. Improves option parsing so values aren’t mistaken for subcommands and clears CLAUDECODE to isolate sessions. Fixes #1782.

  • Bug Fixes
    • Treat rc/remote-control and other management commands as passthrough, even after global options (including inline forms).
    • For passthrough, do not inject --session-id or --settings; always unset CLAUDECODE. Honor --resume/-r and --from-pr by skipping --session-id.
    • Add regression tests for passthrough after options and for edge cases where option values resemble subcommands.

Summary by CodeRabbit

  • Bug Fixes

    • The CLI wrapper now more reliably detects management/configuration/update commands and skips injecting internal session/settings parameters (includes broader command set and resume-like flag handling).
  • Tests

    • Added regression tests covering passthrough behavior for management commands (including cases with global options and resume-like flags) to ensure correct injection or skipping.