fix(claude.sh): forward a claude-bound -- to the CLI instead of consuming it #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/forward-locked-double-dash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
claude mcp add localrecall --env K=V -- /usr/local/bin/localrecall-mcpfails insidethe jail with:
error: missing required argument 'commandOrUrl'
The wrapper consumes the first
--in argv unconditionally as its wrapper/claudeboundary — even here, where
mcphas already locked the workspace slot and everythingafter it belongs to claude. The container's CLI receives the command without its
--,the variadic
--env <env...>swallows the binary path as another env entry, andcommandOrUrlcomes up missing. Reproduced with--dry-runbefore the fix: theforwarded tail shows the
--dropped.Fix
A
--can only be the wrapper boundary while the wrapper is still parsing its ownarguments. Once the slot is locked, no boundary is possible any more, so the
--isappended to
claude_argsinstead of dropped. Passthrough still begins there, so serverarguments spelled like wrapper flags (
--image,--network, …) reach claude verbatim.Unchanged:
claude . -- --model sonnet(boundary consumed as before) and theclaude . -- -- foodoubling idiom.Changes
claude.sh— the--case forwards the token when_workspace_locked=1; Phase 1header comment and
_print_helpupdatedtests/test_arg_parsing.sh— two new tests, written first and watched fail onexactly the dropped
--: a locked--reaches claude; passthrough still appliesafter it
docs/superpowers/specs/2026-07-28-argument-parsing-design.md— contract table splitinto unlocked/locked
--rows, amendment dated 2026-08-25README.md— one paragraph on when--is forwarded rather than consumedVerification
tests/run.sh→ ALL TESTS PASSED (72 tests; arg-parsing file went 17 → 19)… claude-code mcp add --scope user localrecall --env … -- /usr/local/bin/localrecall-mcp