Repository navigation
Fix claude completion for optional-valued flags - #1288
Merged
Merged
Conversation
`--resume`, `--from-pr` and `--worktree` take an optional value in the Claude Code CLI but were declared as `string` flags, so a bare `claude --resume`, the documented way to open the session picker, failed with `nu::parser::missing_flag_param`. Declare them as switches: an extern passes its arguments through in the order they were typed, so `claude --resume <id>` still reaches the CLI as `--resume <id>`. Add the missing `--remote-control`, which takes an optional name in the same way. Refresh the value lists against Claude Code 2.1.302: effort gains `xhigh` and `max`, permission-mode gains `auto` and `manual` and loses `default`, and the model list moves to the current aliases and model IDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0x4D5352
force-pushed
the
claude-optional-value-flags
branch
from
October 18, 2026 22:06
f7a59d1 to
236d9b0
Compare
Contributor
|
Thanks |
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.
--resume,--from-prand--worktreetake an optional value in the Claude Code CLI (-r, --resume [value]inclaude --help), but the extern declared them asstringflags. A bareclaude --resume, which is how you open the interactive session picker, therefore fails to parse:Nushell flags can't have an optional value, so this declares the three as switches. An extern passes its arguments to the external command in the order they were typed, so a value after the switch still arrives where the CLI expects it:
(argv as received by a stub
claudeonPATH.) The one thing lost is the--resume=<id>spelling, which Nushell reads as a boolean on a switch;--resume <id>works.Also:
--remote-control, which was missing and takes an optional name in the same wayxhighandmax; permission-mode gainsautoandmanualand dropsdefault, which the CLI no longer lists as a choice; models moves to the current aliases (fable,opus,sonnet,haiku) and model IDsTested on Nushell 0.116.1:
toolkit.nu check pron the file passes, andcommandline completereturns the new lists for--effort,--permission-modeand--model.🤖 Generated with Claude Code