Skip to content

gstack-ship-budget launch: the claude -p child gets no prompt, because the variadic --allowedTools reads it as one more tool #4448

Closed

Description

@exGeni

What happened

With a token cap on Claude Code (/ship --token-cap 100M), gstack-ship-budget start --session <id> printed verdict=delegate (call=393522 call_floor=40000) and DELEGATE: Steps 1-22 go to a fresh child. handoff --from 1 --to 22 wrote the brief and launch --in <brief> printed CHILD: session=... pid=.... The child exited at once. Its log holds one line:

Error: Input must be provided either through stdin or as a prompt argument when using --print

No return file appeared, and reconcile --handoff <sha> printed RECONCILED: handoff=<sha> child=interrupted child_used=<n> and a budget line ending verdict=stop, so that /ship run ended there. With Claude Code 2.1.311 and this launch command, a /ship that delegates stops at its first handoff.

Expected: the child runs the prompt launch builds ("Load gstack. ... Run /ship --continue : first gstack-ship-budget verify-handoff ...", lib/ship-handoff.ts:303), on the route docs/ship-budget.md:203-204 gives Claude Code: "gstack-ship-budget launch --in <brief>: a background claude -p (resolved through lib/claude-bin.ts) with explicit permission flags and the return file named".

Cause, read at main b79843c (VERSION 1.100.0.0; the same lines run in the 1.99.5.0 install here):

// lib/ship-handoff.ts:291
export const CHILD_PERMISSION_ARGS = ['--permission-mode', 'acceptEdits', '--allowedTools', 'Bash,Read,Edit,Write,Grep,Glob'];
// lib/ship-handoff.ts:307
const child = spawn(claude.command, [...claude.argsPrefix, '-p', '--session-id', session, ...CHILD_PERMISSION_ARGS, prompt], ...);

Claude Code 2.1.311 declares the option as variadic (claude --help: --allowedTools, --allowed-tools <tools...>), so the prompt right after it is read as one more tool name and -p has no input. The launch test cannot see this: test/ship-budget.test.ts:311 replaces claude with a script that prints its arguments, and :318 pins this same order.

Steps to reproduce

No model call is made in step 1; it fails before any request.

  1. claude -p --permission-mode acceptEdits --allowedTools 'Bash,Read' 'Reply with the single word ok' exits 1 with the error above.
  2. claude -p --permission-mode acceptEdits --allowedTools 'Bash,Read' --model haiku 'Reply with the single word ok' exits 0 and prints ok: an option after the list ends it, and the prompt is read.
  3. In a Claude Code session whose context is large (at start, 100k or more above the call floor delegates the whole /ship, docs/ship-budget.md:185-186), on a branch with changes: /ship --token-cap 100M. Once start or a check prints verdict=delegate, the child launched by gstack-ship-budget launch dies with the error above.

Possible fixes, not tried here: send the prompt on stdin, as lib/claude-code.ts:273 already does (child.stdin?.end(options.prompt)); pass the list as one argument (--allowedTools=Bash,Read,Edit,Write,Grep,Glob); or put the prompt before the permission flags. A launch test whose fake claude parses --allowedTools as variadic would catch a regression.

Readiness report

Trimmed to the lines about this path; home paths shortened to ~.

gstack doctor 1.99.5.0
ok              install root    ~/.claude/skills/gstack: openclaw global current (1.99.5.0), codex global current (1.99.5.0), claude global current (1.99.5.0)
ok              state root      ~/.gstack durable=yes (selected by default)
ok              bun             1.4.4 at /usr/local/bin/bun (floor 1.3.3, tested 1.4.2)
ok              claude code     2.1.311 (Claude Code) at /usr/local/bin/claude
ok              session journal largest of 1: 3.0 MiB
15 ok, 0 warn, 0 not configured, 0 fail

Environment

  • Host (Claude Code, Codex, Cursor, ...) and its version: Claude Code 2.1.311
  • OS: Linux 7.0.0
  • gstack: 1.99.5.0 installed; code read at main b79843c (1.100.0.0), where lib/ship-handoff.ts:291 and :307 are unchanged.
  • Related: none found in the tracker (searched the error text, allowedTools, ship-budget launch, cmdLaunch, CHILD_PERMISSION_ARGS, open and closed).

Activity

  1. capy-ai commented on Nov 17, 2026

    @capy-ai
    Contributor

    Thanks for the careful report. I confirmed it at main e0c4136: lib/ship-handoff.ts:307 still puts the prompt right after --allowedTools, and claude --help (2.1.326) declares that option as <tools...>, so the prompt is read as one more tool name. This is on our fix list, and a launch test whose fake claude parses the option the same way will come with it. We'll link the fix here when it lands.

  2. added
    bug
    S3
    on Nov 17, 2026
  3. capy-ai commented on Nov 17, 2026

    @capy-ai
    Contributor

    Fixed in #4452 (merged as 9c6e0a0). gstack-ship-budget launch now ends the options with -- before the prompt, so the claude -p child receives its prompt instead of reading it as one more --allowedTools value. We checked it against Claude Code 2.1.292 and 2.1.326, and the launch test now reads the child's arguments the way the CLI does. Thanks again for the precise report and diagnosis. It ships with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S3bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions