From 236d9b0864675d3196abbb0ffa50b14ba02ea485 Mon Sep 17 00:00:00 2001 From: 0x4D5352 <67082011+0x4D5352@users.noreply.github.com> Date: Sun, 18 Oct 2026 13:46:09 -0500 Subject: [PATCH] Fix claude completion for optional-valued flags `--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 ` still reaches the CLI as `--resume `. 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 --- .../claude/claude-completions.nu | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/custom-completions/claude/claude-completions.nu b/custom-completions/claude/claude-completions.nu index b77b4be82..a5cae743b 100644 --- a/custom-completions/claude/claude-completions.nu +++ b/custom-completions/claude/claude-completions.nu @@ -14,15 +14,15 @@ def "nu-complete claude input-format" [] { } def "nu-complete claude permission-mode" [] { - [acceptEdits bypassPermissions default dontAsk plan] + [acceptEdits auto bypassPermissions manual dontAsk plan] } def "nu-complete claude models" [] { - [sonnet opus haiku claude-sonnet-4-6] + [fable opus sonnet haiku claude-fable-5-1 claude-opus-5-5 claude-sonnet-5-5 claude-haiku-5-5] } def "nu-complete claude effort" [] { - [low medium high] + [low medium high xhigh max] } def "nu-complete claude scope" [] { @@ -41,6 +41,12 @@ def "nu-complete claude install-channel" [] { [stable latest] } +# --resume, --from-pr, --worktree and --remote-control take an optional value, +# which a Nushell flag cannot express, so they are declared as switches. A value +# typed after one is passed to claude in place, as a positional: +# `claude --resume` opens the session picker and `claude --resume ` resumes. +# The `--flag=value` spelling is not available for these flags. + # Claude Code - starts an interactive session by default, use -p/--print for non-interactive output export extern claude [ --debug(-d) # Enable debug mode @@ -66,7 +72,7 @@ export extern claude [ --append-system-prompt: string # Append system prompt --permission-mode: string@"nu-complete claude permission-mode" # Permission mode --continue(-c) # Continue last session - --resume(-r): string # Resume session by ID + --resume(-r) # Resume a session (optional ID or search term) --fork-session # Fork session --no-session-persistence # Disable session persistence --model: string@"nu-complete claude models" # Model to use @@ -84,9 +90,10 @@ export extern claude [ --disable-slash-commands # Disable slash commands --chrome # Enable Chrome --no-chrome # Disable Chrome - --from-pr: string # From PR + --from-pr # Resume a session linked to a PR (optional number or URL) --file: path # Input file - --worktree(-w): string # Git worktree + --worktree(-w) # Create a git worktree (optional name) + --remote-control # Start with Remote Control enabled (optional name) --tmux # Tmux mode --effort: string@"nu-complete claude effort" # Effort level --version(-v) # Show version