Web runs trust the project for Claude Code before the hand-off (fix #1493) - #1597
Merged
Conversation
…1493) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Plainly: starting a Claude web run on an untrusted project no longer needs the one-time "run
claudethere and accept the trust prompt" step. The framework writes the CLI's own trust record for the project root just before the--cloudhand-off, so the dialog never fires. Implements the plan merged in #1556; reverses the read-only-trust decision from #1318, per the maintainer stance in #1493 (UX > safety for now).What changed
src/claude-trust.ts— newwriteClaudeTrust(root): read-modify-write of~/.claude.json, settingprojects[<root>].hasTrustDialogAccepted: true(the exact record the CLI writes when the user accepts). Preserves everything else in the file; creates a missing file; refuses (throws) to replace an existing file it cannot parse.src/driver/cloud.ts—CloudSession.promptreads trust fortrustRootOf(cwd)and writes it when absent, with a visible notice ("trusted for Claude Code on behalf of this run"). Best-effort: a failed write emits a notice and continues, and the existing dialog detection + manual advice stays as the safety net. NewclaudeConfigoption so tests never touch the real~/.claude.json(a gap in the plan — every existing driver test callsprompt()).onClaudeTrustRPC are removed end to end (form, rpc stub, impl, export): there is no doomed start left to warn about.Verification
claude-trustcases (preserve-siblings, create-missing, reshaped-projects, refuse-unparseable), 3 new cloud-driver cases (writes on the root before hand-off + notice, already-trusted stays silent, failed write says so and still hands off). 35/35 node tests, 13/13 StartAgentForm tests, both typechecks clean.writeClaudeTruston that root it boots straight to the REPL, no dialog. The injected record is accepted as the CLI's own. Scratch entry removed afterwards.daemon.test.jsfailures on this machine reproduce on untouched main (live daemon holds the port) — unrelated.Closes the trust paper cut: web runs are click-and-it-works on a fresh project.