Skip to content

Add -- flag passthrough for claude CLI args in new and start#11

Open
danwinn01 wants to merge 1 commit intocraigsc:mainfrom
danwinn01:claude-args-passthrough
Open

Add -- flag passthrough for claude CLI args in new and start#11
danwinn01 wants to merge 1 commit intocraigsc:mainfrom
danwinn01:claude-args-passthrough

Conversation

@danwinn01
Copy link

Summary

cmux new and cmux start currently hardcode the claude invocation with no way to pass additional CLI flags like --dangerously-skip-permissions, --model, or --verbose. This adds the standard Unix -- separator convention so everything after -- is forwarded verbatim to the claude CLI.

cmux new my-branch -- --dangerously-skip-permissions
cmux start my-branch -p "fix it" -- --verbose --model opus

Changes

  • Added -- argument parsing to _cmux_new and _cmux_start that collects remaining args into a claude_args array
  • Forward claude_args to the claude invocation via "${claude_args[@]}"
  • Updated help text and header comments for both commands

Test plan

  • cmux new --help and cmux start --help show updated usage with [-- <claude-args>]
  • cmux new <branch> -- --dangerously-skip-permissions creates worktree and launches claude with the flag
  • cmux start <branch> -- --dangerously-skip-permissions -p "prompt" forwards multiple flags correctly
  • cmux new <branch> without -- works unchanged
  • cmux new <branch> -p "prompt" without -- works unchanged
  • cmux new with no args still prints usage error
  • cmux new -- --flag with no branch still prints usage error

cmux new/start currently hardcode the claude invocation with no way to
pass additional flags like --dangerously-skip-permissions, --model, or
--verbose. This adds the standard Unix -- separator convention so
everything after -- is forwarded verbatim to the claude CLI.

Usage:
  cmux new my-branch -- --dangerously-skip-permissions
  cmux start my-branch -p "fix it" -- --verbose --model opus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants