← Back to Pull requests

fix(daemon): prove a classic Claude launch from the seat's configured executable, as its fork already is #4223

Closed
unknown closed this pull request without merging on Nov 30, 2026 20:17 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 16:42 UTC
Author

The problem

A seat whose Claude runs from a renamed or configured executable can be at its own prompt after an in-place continuation and never read ready.

An in-place continuation launches Claude from the executable it observed in the running seat: the realpath of that Claude's own path (claudeContinuationExecutable in restore-orchestrator.ts). Readiness and handover recovery prove the launch by finding that process. With no recorded executable, a renamed binary isn't recognised as Claude, so the proof never succeeds.

Kayhusk's #3751 fixed this for the fork launch's record. Two launch records still named only a managed launch's executable:

  • the in-memory record of a fresh or resume launch, which readiness proves;

  • the executable a launch returns (launchedExecutable), which handover recovery proves. The fork's return had the same gap.
  • What changes

  • One recorded executable now feeds all three: a managed launch's frozen executable first, then the seat's configured classic one, else none.

  • A configured executable is the verified continuation launch path: the realpath of the path the running Claude was started from.

  • - A wrapper that execs Claude by absolute path leaves the binary as that path, so the binary is what's recorded.
    - A wrapper that keeps argv[0] (exec -a "$0", as Nix's wrapProgram does) records itself.
  • A recorded file that starts with #! is recorded as a script (the managed launch's own fileStartsWithShebang test), and its launch runs in script-launch mode.

  • - Its Claude is proved by the managed script-launch rules (native-process-lineage.ts). It counts if it's a process in the pane's foreground named as Claude and running a Claude executable, or the script's direct child naming a Claude conversation. Either way it still needs this launch's own token, one candidate and a stable fingerprint.
    - So a readable wrapper never makes readiness worse than recording nothing did. A file that can't be read is treated as a plain file.
    - Any other file is recorded with isScript false, and the existing proofs match it, a Nix wrapper and its wrapped sibling included.
  • Unchanged: a launch with no configured executable, and a managed launch.

  • What a recorded path changes: the proof that a pane's Claude is this launch's needs that file, or for a script, the Claude it starts. That's the rule a managed launch already follows.

  • - Readiness asks for that proof for an in-place launch's current frame, and for a screen that doesn't show Claude's header (bypass mode, or a header scrolled out). There, while the process can't be seen or doesn't match, readiness keeps waiting as it does today.
    - A screen that shows Claude's header reads ready from the screen, as before this PR. That check runs before the launch record is looked up.
    - Nothing new refuses, and nothing is typed into the pane.

    This is the last launch record with the gap: a search of the daemon finds no other place that records a launch's executable.

    How it was checked

  • Red first, at main: five new cases in claude-fresh-in-place-scope.test.ts, beside #3751's case, all fail:

  • - a configured fresh in-place launch stays not ready after its own frame is drawn;
    - a configured resume at a headerless bypass prompt times out;
    - the fresh, resume and fork launches return no executable.
  • Green:

  • - the 73 daemon test files that build the Claude adapter or name the launch records: 3,135 passed and 22 skipped, across two runs (one startup file was rerun after building the daemon, which the fresh worktree hadn't done);
    - the daemon typecheck;
    - npm run lint.
  • A second commit corrects the wording only: the first said the configured executable is never a script, but its producer doesn't check the file's format.

  • The third commit (wrappers), from CodeRabbit's review:

  • - Five configured kinds, each an in-place launch that must read ready on its own frame:
    - a wrapper that keeps argv[0] and execs a native version;
    - a wrapper that execs Claude by absolute path;
    - a wrapper that execs a bare claude;
    - a directly configured binary;
    - a Nix wrapper and its wrapped sibling.
    - Red at the second commit:
    - the first two wrappers stay awaiting_runtime ("Waiting to confirm the new Claude process in this pane");
    - the bare-claude wrapper reads ready, and fails only on its record's isScript;
    - the binary and the Nix pair pass.
    - Green: all 63 cases in that file. The same 73 files as above: 3,140 passed and 22 skipped. npm run lint passes.
  • Not run: a real tmux pane with a renamed Claude executable or a wrapper.
  • Not changed

  • The legacy restore resume (claude-resume.ts) checks its process without an executable too. It keeps no launch record, so it's left as it is here.

  • The ordering of readiness's screen check before the launch-record lookup is older than this PR, and this PR doesn't change it.
  • 🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Claude launches now consistently report the configured executable, including fresh, resumed, forked, and classic continuation launches. This improves launch reporting when using custom executable paths or wrappers.
    Fresh in-place launches wait for the configured process to display its first frame before showing the session as ready, including when the executable is renamed or invoked through a wrapper.
    Classic continuations can be recognized when the prompt has no header.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: mvschwarz Review duration: 215m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.80) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.80 · 650 lines diff across 8 files
    0.80
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.080
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #4223"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 80.2% (HIGH) · Higher = larger blast radius
    80.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 31.7% · Safe to merge
    31.7%