fix(setup): auto-submit handoff context as Claude's first prompt#2741
Merged
Conversation
Interactive setup handoffs (mid-flow `?` escape and on-failure) spawned claude with all context in --append-system-prompt and no user message, so Claude sat at an empty REPL until the user re-explained themselves. Move the context into a positional prompt that auto-submits as the first user message: Claude starts orienting immediately, the context stays visible in the transcript, and it survives --resume. Also: - Share one session across all handoffs in a setup run: pin a generated UUID via --session-id on the first spawn, --resume it on later ones (stdio is inherited, so Claude's own id is never visible). - Switch --permission-mode from acceptEdits to auto. - Dedupe the two spawn blocks into spawnInteractiveClaude(). Co-Authored-By: Claude Fable 5 <[email protected]>
35c6f1b to
67ccd9e
Compare
This was referenced Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the interactive setup flow hands off to Claude (the mid-flow
?help escape and the on-failure debug handoff insetup/lib/claude-handoff.ts), all the context was passed via--append-system-promptwith no user message. Interactive Claude only acts when a user message arrives, so the session opened at an empty REPL and the user had to re-explain a situation Claude had already been told about.Changes
--resume, which an appended system prompt would not. Matches the styleclaude-assist.tsalready uses for its non-interactive prompt.--session-id; later spawns--resumeit, so a second handoff keeps the context of the first. (stdio is inherited, so pinning our own id is the only way to find the session again.) Kept separate from claude-assist's-psession, which is primed with a strict REASON/COMMAND response format.acceptEdits→auto.spawnInteractiveClaude()helper.Testing
tsc --noEmitclean on the module--permission-mode auto,--session-id, and--resumeagainst the installedclaudeCLI🤖 Generated with Claude Code