Repository navigation
Description
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.
claude -p --permission-mode acceptEdits --allowedTools 'Bash,Read' 'Reply with the single word ok'exits 1 with the error above.claude -p --permission-mode acceptEdits --allowedTools 'Bash,Read' --model haiku 'Reply with the single word ok'exits 0 and printsok: an option after the list ends it, and the prompt is read.- 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. Oncestartor acheckprintsverdict=delegate, the child launched bygstack-ship-budget launchdies 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
capy-ai commentedon Nov 17, 2026
Thanks for the careful report. I confirmed it at main e0c4136:
lib/ship-handoff.ts:307still puts the prompt right after--allowedTools, andclaude --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 fakeclaudeparses the option the same way will come with it. We'll link the fix here when it lands.Token-capped /ship hands its child Claude Code session its prompt (#4448
capy-ai commentedon Nov 17, 2026
Fixed in #4452 (merged as 9c6e0a0).
gstack-ship-budget launchnow ends the options with--before the prompt, so theclaude -pchild receives its prompt instead of reading it as one more--allowedToolsvalue. 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.