Skip to content

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

Merged
craigsc merged 1 commit intocraigsc:mainfrom
danwinn01:claude-args-passthrough
Apr 18, 2026
Merged

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

Conversation

@danwinn01
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Collaborator

@siennathesane siennathesane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@craigsc
Copy link
Copy Markdown
Owner

craigsc commented Apr 18, 2026

Thank you for contributing! And apologies about the delay in reviewing, I've been an absentee parent :(

@craigsc craigsc merged commit 51c9542 into craigsc:main Apr 18, 2026
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.

4 participants