Skip to content

Token-capped /ship hands its child Claude Code session its prompt (#4448) - #4452

Merged
capy-ai[bot] merged 1 commit into
mainfrom
ship-handoff-child-gets-its-prompt
Nov 17, 2026
Merged

capy-ai[bot] merged 1 commit into
mainfrom
ship-handoff-child-gets-its-prompt

Conversation

@garrytan

@garrytan garrytan commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

A /ship with a token cap on Claude Code no longer stops at its first handoff: the child claude -p session now gets its prompt.
Why: --allowedTools takes every argument after it, so the prompt was read as one more tool name and the child exited at once. The launch now puts -- before the prompt.
Nothing to do. Thanks to @exGeni for the report and diagnosis.

What changed

Claude Code 2.1.292 with the launch argv: before, the prompt is swallowed by --allowedTools; after, -- hands it over

Claude Code 2.1.292 with the launch argv: before, the prompt is swallowed by --allowedTools; after, -- hands it over.

Before/after as text: Claude Code 2.1.292 with the launch argv: before, the prompt is swallowed by --allowedTools; after, -- hands it over
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ claude -p --session-id <id> --permission-mode acceptEdits --allowedTools Bash,Read,Edit,Write,Grep,Glob -- <prompt>
+Invalid API key · Fix external API key
+(prompt accepted; stops at the deliberately fake key, so no model call)
-$ claude -p --session-id <id> --permission-mode acceptEdits --allowedTools Bash,Read,Edit,Write,Grep,Glob <prompt>
-Error: Input must be provided either through stdin or as a prompt argument when using --print
-(exit 1)
 

A token-capped /ship that hands work to a fresh Claude Code session started that session and then stopped, because the child printed "Input must be provided either through stdin or as a prompt argument" and exited. gstack-ship-budget launch now ends the options with --, so the child reads its prompt and the run carries on. The launch test now reads the child's arguments the way Claude Code does and requires exactly one prompt.

Why

"The child exited with 'Input must be provided'" (#4448): the first handoff of a capped /ship killed the run. Now the child gets its instructions and the run continues past the handoff.

Blast radius

Only cmdLaunch in lib/ship-handoff.ts changes, and only the argument list it passes to claude. -- is the standard end-of-options marker, and the real Claude Code 2.1.292 binary (the CI pin) accepted the prompt after it in a repro (script ran). The other place gstack starts Claude Code, lib/claude-code.ts, sends its prompt on stdin, so it never had this problem (file read).

Test Coverage

All new code paths have test coverage: the one changed line is covered by the extended launch test in test/ship-budget.test.ts (★★★).
Tests: 1798 → 1798 (+0 new)
Coverage: 100% value-weighted (100% including 0 weakly covered paths)
Test value: 0 tests written, 0 rejected by the authoring gate, 1 existing test extended, 0 paths weakly covered (weak = ★, gate-failing or unrated).
Tests ran: ship-budget 24

Pre-Landing Review

No issues found. One specialist reviewer (testing, security, state machines, red team) found nothing; the adversarial reviewer raised three low-severity notes, none blocking.

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • test/ship-budget.test.ts:308: the regression test checks a hand-written model of Claude Code's argument parser, not the real CLI, so a future change to how Claude Code reads -- would not turn it red. The real-CLI repro above covers 2.1.292 today.
  • lib/ship-handoff.ts:307: on Windows through WSL (wsl claude ... -- <prompt>), whether wsl.exe passes -- through is unverified, and the prompt's unquoted paths go through the Linux shell (that part predates this change).
  • lib/ship-handoff.ts:310: launch reports success as soon as the child starts and never notices a child that dies at once, which is why this bug went quiet (predates this change).
Exploratory QA

Surface: command line. Charter: the argument list launch builds gives the real Claude Code CLI exactly one prompt.

  • Pass: Claude Code 2.1.292 with ... --allowedTools Bash,Read,Edit,Write,Grep,Glob -- <prompt> accepted the prompt and stopped at the deliberately fake API key (no model call).
  • Pass (negative control): the same arguments without -- exit 1 with "Input must be provided either through stdin or as a prompt argument when using --print".
  • Limit: the evidence recorder marked both captures sensitive (the CLI prints "Invalid API key"), so they were read directly instead of published as checkpoints. The probe drove the CLI with the same arguments, not through launch's own spawn, which the unit test covers.
Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). This is a bug fix, exempt from plan review.

Issues

Fixes #4448

TODOS

No TODO items completed in this PR.

Documentation

Status: current — no documentation changes needed.

Scope: base e0c4136..95436ae (1 commit: lib/ship-handoff.ts, test/ship-budget.test.ts, changelog.d/ship-handoff-child-gets-its-prompt.md); no staged, unstaged or new files. The fix makes gstack-ship-budget launch end Claude Code options with -- before the child's prompt.

Documentation health:

  • docs/ship-budget.md — Current (describes launch as a background claude -p with permission flags; argument order is not documented)
  • docs/troubleshooting.md — Current (gstack-ship-budget section unaffected)
  • changelog.d/ship-handoff-child-gets-its-prompt.md — Present (parent-owned)

Coverage debt: none; no new commands, flags, config or env vars.

Diagram drift: none.

Tests
  • bun test test/ship-budget.test.ts: 24 pass, 0 fail
  • Claude Code 2.1.292 argv repro (fixed and pre-fix arguments): prompt accepted with --; "Input must be provided" without it
  • Push guards: typecheck, module-size, conflict-markers passed
Agent notes

GST-2995. Refs #4448

Approvals

No approvals recorded for branch ship-handoff-child-gets-its-prompt.
Plan: exempt: bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=2 dispatches=1
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: skipped by the review plan (code class, no numeric claims).

🤖 Generated with Claude Code

{
  "schema_version": 1,
  "pr": 4452,
  "head": "95436ae1d49e272014b67c83290309453463bc37",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "ship-budget": {
      "pass": 24,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "run": "ship-4452",
  "head_tree": "d05f381de50cab095807514309f380d8f7cf88e3",
  "product_patch_id": "4ef58731eca3ec490a25e14b09e51a3c72f79aa2",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 2,
    "rules": "66e5174161eecc2c",
    "base": "e0c4136dc2999840720091ee772666127099e13d",
    "registry": "e0c4136dc2999840720091ee772666127099e13d",
    "gate_scan": {
      "tagged": 0,
      "head": "95436ae1d49e272014b67c83290309453463bc37"
    },
    "reasons": [
      "runtime=2"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "pass @d05f381de50c (8 checks, current for 95436ae1d49e)",
  "issues": {
    "fixes": [
      4448
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CONTRIBUTING.md (base e0c4136..95436ae)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}

)

A /ship with a token cap on Claude Code no longer stops at its first
handoff: the child claude -p now receives the prompt instead of reading
it as one more --allowedTools entry.

Why: --allowedTools takes every following argument, so the child exited
with "Input must be provided" and the run stopped. The launch now ends
the options with -- before the prompt.

Nothing to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot merged commit 9c6e0a0 into main Nov 17, 2026
54 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
- A test, or a scratch repository in the temp directory, can no longer write approval rows into your real Capy Drive (GST-3027). (#4466)
- An unattended /autoplan run on Claude Code no longer says the publication guard is off while it is on. (#4481)
- A phase report written only in reasoning now gets a denial that says so and names the fix. (#4481)
- `gstack-autoplan revise` no longer refuses a plan that the first `next` accepted. (#4470)
- `revise --plan` with a different file now says the run follows that file. (#4470)
- A second-model plan review in `/autoplan` is no longer reported as unavailable when it actually ran (GST-3051). (#4471)
- The /ship conductor trial plan now lets case reverts that conflict with later code be resolved by hand in docs, tests and the planted file, so large pull requests can be cases (GST-3003). (#4460)
- A locked plan for a trial of /ship without its separate conductor subagent (GST-3003). (#4456)
- A driven /ship now runs each phase as one command, counts its calls, and stops itself at 100 minutes. (#4451)
- /ship stops asking owners to clear two kinds of bookkeeping noise: base-side merge text and a reviewer's confirmation prose. (#4458)
- A base merge that only touched base-side text no longer stops `/ship` finish for an owner's grant. (#4458)
- A reviewer's confirmation prose no longer becomes a Critical finding that only an owner can clear. (#4458)
- A CI run that passed only after its failed jobs were re-run is now marked wherever gstack reuses it. (#4473)
- /ship reuses CI's passing test run when merging the base changed no file, and stops instead of quietly starting hour-long test runs or reviewing an empty diff (GST-3019). (#4461)
- /ship on Codex no longer stops at the test coverage audit. (#4489)
- A cold first-use check before an app build reaches its owner (GST-3025). (#4465)
- `skill_prefix=true` now survives updates when gbrain is installed. (#4454)
- The OpenClaw docs no longer send you to ClawHub, which held only April 2026 builds of office-hours, ceo-review and retro and no longer has gstack skills (the docs also said four skills while listing three). (#4454)
- `gstack-issue-links` no longer reads other repositories' issues as gstack's. (#4454)
- /ship's pre-gate finds the tests of a monorepo app that imports through its own `@/` alias. (#4464)
- /office-hours explains why it recommends a mode. (#4450)
- /office-hours keeps its 34 founder videos and essays out of the skill file. (#4463)
- Two `gstack-owner-answers add` runs for the same answer no longer collide. (#4490)
- A Captain can check an ask against the owner's earlier answers before sending it. (#4467)
- `gstack-post` stops reading /ship's own receipt identifiers as phone numbers, so posting a /ship PR body no longer needs a confirm. (#4488)
- GitHub release notes now list every change in plain words, with a link to its pull request. (#4390)
- gstack's router no longer gives bug reports a special rule, so the model fixes a bug the way it would without gstack. (#4442)
- /ship's review plan now sorts Swift and Xcode files by risk instead of sending every iOS PR to the full review panel (GST-3041). (#4469)
- /ship's review plan now sends Swift code that touches private user data to the full review panel (GST-3052). (#4472)
- A round grant at /ship's review round cap now buys the fix round it names, in the same run or the next (GST-2968). (#4479)
- The secrets check stops flagging three kinds of ordinary code as a secret, and catches two misses. (#4457)
- A security finding's location and reason no longer go into a PR body. (#4486)
- The token-capped /ship child on Claude Code now starts its prompt with the typed `/ship` command, so the skill actually loads. (#4487)
- A /ship receipt now counts the second-model review's blocking findings, and refuses to be written while one is still open. (#4485)
- A `/ship` with a token cap on Claude Code no longer stops at its first handoff. (#4452)
- /ship's push step now always ends with one line that says whether it pushed (GST-3053). (#4474)
- A PR's review-round count can no longer be overwritten by the body `/ship` posts. (#4440)
- One queued record with a malformed path no longer stops artifacts sync for every project. (#4455)
- A failed artifacts push stays reported until a push succeeds. (#4455)
- The /sync-gbrain memory row no longer says OK when pages failed to import. (#4455)
- ### Tests (#4495)
- A policy-floor test no longer fails once gstack's own version reaches the minor after the newest policy key; it now checks a floor above both, so the v1.101.0.0 release can pass CI. (#4495)
- CI now uploads free-suite test results to Trunk with analytics-uploader v2.1.8 and analytics-cli 0.17.0, up from v2.1.6 and 0.16.2. (#4453)
- Packing a checkout for a Ubicloud run no longer fails when git beside it is rewriting a ref. (#4447)
- The /plan-ceo-review HOLD SCOPE eval no longer fails a review because its follow-up question didn't repeat the mode name. (#4447)
- Unattended /autoplan now records the owner's relayed gate reply instead of refusing it. (#4484)
- Unattended /autoplan now runs the second-model review you turned on, and waits for it instead of ending the session. (#4459)
- Two /autoplan runs started in the same second no longer share a run id. (#4459)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant