Add -- passthrough args to cmux new and cmux start#13
Closed
zandaleph wants to merge 1 commit intocraigsc:mainfrom
Closed
Add -- passthrough args to cmux new and cmux start#13zandaleph wants to merge 1 commit intocraigsc:mainfrom
zandaleph wants to merge 1 commit intocraigsc:mainfrom
Conversation
Allows passing arbitrary flags to the claude invocation by placing them after a -- separator, e.g.: cmux start my-branch -- --dangerously-skip-permissions cmux new my-branch -p "do the thing" -- --dangerously-skip-permissions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Closing in favor of #11 which covers the same ground. I implemented this independently and arrived at the same approach — can confirm it works well. One small suggestion for #11: adding an example line to the help text would help with discoverability, e.g. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--separator support tocmux newandcmux startso that any arguments after--are forwarded directly to theclaudeinvocation--dangerously-skip-permissionsand other claude CLI flags that aren't exposed by cmux todayUsage
Motivation
When migrating from tools like gastown that pass extra flags to claude on startup, there was no way to forward arbitrary claude CLI flags through cmux. The
--convention is a standard Unix idiom for separating a wrapper's own arguments from those passed to a subprocess, making it guessable and consistent with tools likenpm run,git, etc.Test plan
cmux new --helpandcmux start --helpshow updated usage with[-- <claude-args>]cmux new <branch>(no--) still works as beforecmux start <branch>(no--) still works as beforecmux start <branch> -- --dangerously-skip-permissionspasses the flag to claudecmux new <branch> -p "prompt" -- --flagpasses both prompt and flag correctlycmux new -- --flag(no branch) shows usage error🤖 Generated with Claude Code