Skip to content

fix(setup): auto-submit handoff context as Claude's first prompt#2741

Merged
gavrielc merged 1 commit into
mainfrom
setup-handoff-kickoff-prompt
Jun 11, 2026
Merged

fix(setup): auto-submit handoff context as Claude's first prompt#2741
gavrielc merged 1 commit into
mainfrom
setup-handoff-kickoff-prompt

Conversation

@gavrielc

Copy link
Copy Markdown
Collaborator

Problem

When the interactive setup flow hands off to Claude (the mid-flow ? help escape and the on-failure debug handoff in setup/lib/claude-handoff.ts), all the context was passed via --append-system-prompt with 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

  • Auto-submitted prompt: the handoff context (step, error, completed steps, redacted collected values, file references) is now built into a first-person prompt passed positionally, so it auto-submits and Claude starts orienting immediately. It's also visible in the transcript and survives --resume, which an appended system prompt would not. Matches the style claude-assist.ts already uses for its non-interactive prompt.
  • Session continuity: all handoffs in one setup run now share a session. The first spawn pins a generated UUID via --session-id; later spawns --resume it, 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 -p session, which is primed with a strict REASON/COMMAND response format.
  • Permission mode: acceptEditsauto.
  • The two duplicated spawn blocks are merged into a spawnInteractiveClaude() helper.

Testing

  • tsc --noEmit clean on the module
  • Verified --permission-mode auto, --session-id, and --resume against the installed claude CLI

🤖 Generated with Claude Code

@gavrielc gavrielc requested a review from gabi-simons as a code owner June 11, 2026 11:48
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]>
@gavrielc gavrielc force-pushed the setup-handoff-kickoff-prompt branch from 35c6f1b to 67ccd9e Compare June 11, 2026 12:15
@gavrielc gavrielc merged commit 421f870 into main Jun 11, 2026
1 check passed
@gavrielc gavrielc deleted the setup-handoff-kickoff-prompt branch June 11, 2026 14:37
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.

1 participant