Repository navigation
fix(claude): stop Orca making a WSL user's ~/.claude.json world-readable - #23973
Conversation
… behind The replacement file is now created before Claude's lock is taken, so the locked path must remove it.
Review status: ready for review, with one end-to-end check pending an owner decisionThe problem: since #23744 (merged, not yet released), when Orca starts Claude in a WSL project and writes Claude's "trust this folder" entry into the WSL user's What changes for the user: after this PR the file keeps exactly the permissions it had. If Orca cannot copy the permissions, it writes nothing and Claude shows its own trust prompt, as every released build does today. Code review: two independent review passes. Both came back clean. The first added one test assertion (a skipped write leaves no temporary file behind; commit Live check (Windows test machine, WSL Ubuntu-24.04, scratch config files only): this branch's writer and main's were built and run from Windows Node the way Orca calls them.
Other checks: Pending: the same check through a real Orca-started Claude. For a WSL project without a managed Claude account, that launch writes the test machine's real guest Accepted trade-offs (each fails safe: Claude asks): a WSL distro whose |
|
| // Why before the lock: a WSL guest's mode takes a guest process to copy, and Claude's | ||
| // lock should stay held only for the synchronous read → rename below. | ||
| const replacement = await createReplacementFile(probe.path) |
There was a problem hiding this comment.
Stale permissions can be restored If Claude or another process tightens the config from 0644 to 0600 while this operation waits for the lock, the replacement still has the earlier 0644 mode. The locked re-read checks the path but not the mode, so renaming the replacement makes the account config world-readable again. Copy or validate the mode as part of the protected write. How this was verified: The replacement gets its mode before lock acquisition, and the locked path check does not compare it with the current config’s mode.
|
|
||
| beforeEach(() => { | ||
| guest.root = realpathSync(mkdtempSync(join(tmpdir(), 'orca-claude-trust-guest-'))) | ||
| mkdirSync(join(guest.root, 'home/u'), { recursive: true }) |
There was a problem hiding this comment.
Real WSL path remains untested This regression suite skips Windows and mocks both the UNC filesystem and the WSL process. The Windows WSL E2E job does not check this trust write either, so a failure in the real guest permission-copy path could pass automated tests. Add an automated Windows/WSL grant check that verifies the guest file’s mode afterward.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe trust-file rewrite now prepares a replacement file with the target’s permission bits before acquiring the lock. For WSL UNC targets, it copies permissions with guest Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The change stops WSL guest ~/.claude.json files from becoming world-readable and falls back to a Claude trust prompt if the permission copy fails. The supplied evidence shows no remaining merge-blocking risk. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The change prevents ordinary WSL trust updates from making private account files readable by other users. However, preparing permissions before taking the update lock can undo a concurrent permission restriction. This requires overlapping file changes and affects the user's Claude configuration rather than a shared service. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description is detailed and covers the change, rationale, testing, security, and platform impact. However, it explicitly provides no linked issue despite the template requiring one, and the required lint, typecheck, test, and build checklist item remains unchecked. Resolution Add a link to the actual issue addressed by this pull request, or attach the pre-existing issue referenced by the change. Confirm that pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass, or state that CI will cover them and update the checklist accordingly.
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline, plus a nitpick.
Reviewed changes
- WSL guest permission widening fixed.
writeConfigAtomicallyis split intocreateReplacementFile(creates an empty temp at the target's mode before the lock) andreplaceConfig(fills it withflag: 'r+', then atomic rename). For a\\wsl.localhostconfig the temp's mode is copied by a guestchmod --referenceinstead of relying on Windows' synthetic0o666, so the guest's0600survives the replace. - Fail-closed failure path. A failed guest
chmodthrows before any content is written, the temp is removed, and the grant reports a failure so Claude asks — no half-replaced or widened file. - Coverage. The new
claude-folder-trust-file-wsl-guest.test.tsmodels Windows Node over\\wsl.localhost(synthetic0o666, unreachable chmod, new files at0644) and genuinely fails onmain(0644vs0600); the native test now asserts no temp file lingers after a lock-skipped write.
One behavior change worth pinning. A native config whose owner cannot write it (0400/0444, or the Windows read-only attribute) now fails the grant where main replaced it, because replaceConfig reopens the temp with r+ and the temp was created at that read-only mode. It fails closed and the PR body calls it out, but nothing tests it — see nitpick below.
ℹ️ Nitpicks
- The read-only-config behavior change is a real, if narrow, difference from
mainand has no test; adding one would pin it if it was intentional and catch an accidental widening if it was not.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| // Why before the lock: a WSL guest's mode takes a guest process to copy, and Claude's | ||
| // lock should stay held only for the synchronous read → rename below. | ||
| const replacement = await createReplacementFile(probe.path) |
There was a problem hiding this comment.
The replacement's mode is captured before the lock and never re-validated. createReplacementFile reads the target's mode (native statSync at line 173) or copies it via the guest chmod --reference (lines 163-168) here, before lock() is taken; under the lock only the resolved path is compared to replacement.target (line 249), not the mode or inode. A concurrent narrowing chmod on the target during that window (which spans the guest round trip plus lock retries) means the rename publishes the older, wider mode over a now-narrower file, so the JSDoc's "can never widen them" (line 152) does not hold. main read the mode under the lock inside writeConfigAtomically, so this is a small regression in the exposure ordering on a fix whose whole point is to stop widening.
Technical details
# Mode captured before the lock, not re-checked under it
## Affected sites
- src/main/claude/claude-folder-trust-file.ts:173 — native `statSync(target).mode` read before the lock
- src/main/claude/claude-folder-trust-file.ts:163-168 — guest `chmod --reference` copies the mode before the lock
- src/main/claude/claude-folder-trust-file.ts:226 — `createReplacementFile` call site, ahead of `lock()` at line 230
- src/main/claude/claude-folder-trust-file.ts:249 — under the lock, only `current.path` is compared, not mode/inode
## Required outcome
- The file renamed over the target must never carry a wider mode than the target has at rename time.
## Suggested approach
- Under the lock, re-stat the target's mode (and inode) and, if it changed since the replacement was prepared, abort (return `unreadable`) rather than publishing the stale mode. Aborting on the guest path avoids a second `wsl.exe` round trip inside the lock.
## Open questions for the human
- Is the narrow race worth the extra under-lock stat, or is the current pre-lock capture an accepted tradeoff given it fails closed on every other path?…nner commit Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…STA-9051) (#24217) * feat(terminal): warn when a typed Codex joins Codex's shared server Orca adds --no-daemon to the Codex it launches and to a codex typed in shells whose wrapper it controls, but a codex typed another way (fish, cmd.exe, a path-named binary) still joins Codex's shared server, which mixes up agent status across tabs. When a local pane's Codex is on that server, show a banner at the top of the pane with the command that turns auto-start off, a Copy button, "Don't show again" (a new setting next to the Codex server setting) and a per-pane dismiss. The banner takes layout space; the terminal refits below it. Main answers pty:isCodexOnSharedServer from the pane's outermost Codex command line (flags and subcommands that keep Codex embedded rule it out), the CODEX_HOME the pane launched with, and whether that home's server is live: a socket connect on macOS/Linux, the server's pid record plus creation time on Windows. The renderer asks only while the pane already shows Codex, on a short bounded ladder. Refs STA-9051 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix: restore the Claude WSL trust-file fix (#23973) dropped by the banner commit Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * feat(terminal): redesign the Codex shared-server banner and fix dialog Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * feat(terminal): let the Codex shared-server fix run its commands The fix dialog now runs each step with the shared server's own Codex on the pane's CODEX_HOME, verifies the result (feature read back, server probed), and falls back to a copyable command on failure. Stopping asks first. Also: an apostrophe in a prompt no longer hides an opt-out flag, restored panes fall back to the saved pty id, and the IPC guards have a table test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * feat(terminal): give each fix step its own card and label the command it runs Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * refactor(terminal): simplify the Codex shared-server banner after review - Read a subcommand only from Codex's first positional, so prompt words like "a", "update" or "review" no longer hide the banner. - Probe the server fresh on every ask; drop the probe cache. - Make the pty preload methods required and stub them on the web client, replacing the optional-method and paired-client checks. - Render the banner from the existing Codex pane portal loop. - Treat a non-zero or timed-out Codex command as failed; skip the read-back when the disable write failed. - Reserve the banner's space with a CSS :has() selector instead of a data attribute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(terminal): make the Codex shared-server fix persist on Orca's mirror home - Step 1 now writes daemon_auto_start = false to the user's own Codex home when the pane runs on Orca's shared mirror home (as Windows panes do), then to the mirror home too; the mirror is rebuilt from the user's home on every launch, so a mirror-only write was lost. - The server probe is three-state (live / absent / unknown); stop reports success only once the server is proven gone. - The banner retires the one-time "runs Codex without its shared server" toast it contradicts. - A command line with no Codex program never counts as joining the server. - The fallback local PTY provider reports each pane's root pid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(codex): keep Turn off in Orca's Codex home when ~/.codex has no config A pane on Orca's mirror home wrote the setting to ~/.codex first. With no ~/.codex the spawn failed on its cwd and Codex rejects a missing CODEX_HOME; and creating a config holding only this setting would make the next mirror replace every setting made in Orca's Codex. The mirror skips a missing or blank ~/.codex/config.toml, so write only the mirror home then. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * feat(codex): promote [features].daemon_auto_start from Orca's Codex home Promotion now carries one [features] key alongside the [tui] keys, so a shared-server Turn off written in Orca's mirror home reaches ~/.codex/config.toml instead of being reverted by the next mirror. Table keys share one <table>.<key> scan for read, removal and upsert. Orca's own daemon socket override is never read as a user value, and a blank source config is seeded from the runtime like a missing one. * refactor(codex): run Turn off once, in the pane's own Codex home Settings promotion now carries the setting to ~/.codex, so the separate settings-home resolution and the two-home loop are gone. * fix(terminal): offer Stop server only after sharing is turned off Stopping while sharing is still on closes every sharing session, and the next Codex starts a new shared server. * fix(terminal): skip legacy mirror panes off Windows and quoted dotted keys A retained shared-home pane on macOS/Linux points at a mirror that is no longer promoted, so Turn off there would be reverted; name no home for it. A quoted top-level key such as "tui.theme" is one key, not [tui].theme. * fix(terminal): drop the Turn off note that promised the setting reaches Codex outside Orca Orca's tabs are what this fix is for; carrying the setting to ~/.codex is best-effort. * fix(terminal): keep the Turn off note that the setting also applies outside Orca It holds for nearly everyone; the rare Windows upgrade gaps don't justify hiding it. * fix(codex): promote Turn off to ~/.codex under an older Orca's baseline A pane on Orca's Windows mirror home writes daemon_auto_start = false into the mirror. A promotion baseline from an Orca that predates this key has no entry for it, so the next mirror pass kept the write as a conflict and then recorded it, and ~/.codex never got the setting. Turn off on a mirror-home pane now runs the same mirror pass a terminal launch runs before and after the write: the first records the key in the baseline, the second promotes the write to ~/.codex. The passes are synchronous, so they cannot interleave with a launch's pass. A failed pass is logged and does not fail Turn off, since the write still fixes Orca's tabs. Real-home panes are unchanged. --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…ble (stablyai#23973) * fix(claude): keep a WSL guest's ~/.claude.json mode when Orca writes folder trust * test(claude): assert a skipped trust write leaves no replacement file behind The replacement file is now created before Claude's lock is taken, so the locked path must remove it. (cherry picked from commit 95e8725)
…STA-9051) (stablyai#24217) * feat(terminal): warn when a typed Codex joins Codex's shared server Orca adds --no-daemon to the Codex it launches and to a codex typed in shells whose wrapper it controls, but a codex typed another way (fish, cmd.exe, a path-named binary) still joins Codex's shared server, which mixes up agent status across tabs. When a local pane's Codex is on that server, show a banner at the top of the pane with the command that turns auto-start off, a Copy button, "Don't show again" (a new setting next to the Codex server setting) and a per-pane dismiss. The banner takes layout space; the terminal refits below it. Main answers pty:isCodexOnSharedServer from the pane's outermost Codex command line (flags and subcommands that keep Codex embedded rule it out), the CODEX_HOME the pane launched with, and whether that home's server is live: a socket connect on macOS/Linux, the server's pid record plus creation time on Windows. The renderer asks only while the pane already shows Codex, on a short bounded ladder. Refs STA-9051 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix: restore the Claude WSL trust-file fix (stablyai#23973) dropped by the banner commit Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * feat(terminal): redesign the Codex shared-server banner and fix dialog Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * feat(terminal): let the Codex shared-server fix run its commands The fix dialog now runs each step with the shared server's own Codex on the pane's CODEX_HOME, verifies the result (feature read back, server probed), and falls back to a copyable command on failure. Stopping asks first. Also: an apostrophe in a prompt no longer hides an opt-out flag, restored panes fall back to the saved pty id, and the IPC guards have a table test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * feat(terminal): give each fix step its own card and label the command it runs Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * refactor(terminal): simplify the Codex shared-server banner after review - Read a subcommand only from Codex's first positional, so prompt words like "a", "update" or "review" no longer hide the banner. - Probe the server fresh on every ask; drop the probe cache. - Make the pty preload methods required and stub them on the web client, replacing the optional-method and paired-client checks. - Render the banner from the existing Codex pane portal loop. - Treat a non-zero or timed-out Codex command as failed; skip the read-back when the disable write failed. - Reserve the banner's space with a CSS :has() selector instead of a data attribute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(terminal): make the Codex shared-server fix persist on Orca's mirror home - Step 1 now writes daemon_auto_start = false to the user's own Codex home when the pane runs on Orca's shared mirror home (as Windows panes do), then to the mirror home too; the mirror is rebuilt from the user's home on every launch, so a mirror-only write was lost. - The server probe is three-state (live / absent / unknown); stop reports success only once the server is proven gone. - The banner retires the one-time "runs Codex without its shared server" toast it contradicts. - A command line with no Codex program never counts as joining the server. - The fallback local PTY provider reports each pane's root pid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(codex): keep Turn off in Orca's Codex home when ~/.codex has no config A pane on Orca's mirror home wrote the setting to ~/.codex first. With no ~/.codex the spawn failed on its cwd and Codex rejects a missing CODEX_HOME; and creating a config holding only this setting would make the next mirror replace every setting made in Orca's Codex. The mirror skips a missing or blank ~/.codex/config.toml, so write only the mirror home then. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * feat(codex): promote [features].daemon_auto_start from Orca's Codex home Promotion now carries one [features] key alongside the [tui] keys, so a shared-server Turn off written in Orca's mirror home reaches ~/.codex/config.toml instead of being reverted by the next mirror. Table keys share one <table>.<key> scan for read, removal and upsert. Orca's own daemon socket override is never read as a user value, and a blank source config is seeded from the runtime like a missing one. * refactor(codex): run Turn off once, in the pane's own Codex home Settings promotion now carries the setting to ~/.codex, so the separate settings-home resolution and the two-home loop are gone. * fix(terminal): offer Stop server only after sharing is turned off Stopping while sharing is still on closes every sharing session, and the next Codex starts a new shared server. * fix(terminal): skip legacy mirror panes off Windows and quoted dotted keys A retained shared-home pane on macOS/Linux points at a mirror that is no longer promoted, so Turn off there would be reverted; name no home for it. A quoted top-level key such as "tui.theme" is one key, not [tui].theme. * fix(terminal): drop the Turn off note that promised the setting reaches Codex outside Orca Orca's tabs are what this fix is for; carrying the setting to ~/.codex is best-effort. * fix(terminal): keep the Turn off note that the setting also applies outside Orca It holds for nearly everyone; the rare Windows upgrade gaps don't justify hiding it. * fix(codex): promote Turn off to ~/.codex under an older Orca's baseline A pane on Orca's Windows mirror home writes daemon_auto_start = false into the mirror. A promotion baseline from an Orca that predates this key has no entry for it, so the next mirror pass kept the write as a conflict and then recorded it, and ~/.codex never got the setting. Turn off on a mirror-home pane now runs the same mirror pass a terminal launch runs before and after the write: the first records the key in the baseline, the second promotes the write to ~/.codex. The passes are synchronous, so they cannot interleave with a launch's pass. A failed pass is logged and does not fail Turn off, since the write still fixes Orca's tabs. Real-home panes are unchanged. --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit eefc49f)


ELI5
When Orca starts Claude in a WSL project, it adds one entry to the WSL user's
~/.claude.jsonso Claude does not stop to ask "Do you trust this folder?". Since #23744, that write also made the file readable by every user on the Linux system (0600 became 0644). The file holds the user's Claude account details. After this change the file keeps exactly the permissions it had.What Changed
Problem. A WSL user's
~/.claude.jsonbecomes world-readable after Orca starts Claude there. Post-merge QA of #23744 on a Windows machine with an Ubuntu 24.04 WSL distro saw the guest file go from 0600 to 0644 after one Orca-started Claude launch.Who is affected. Windows users with WSL projects and the "Trust the folder when Orca starts an agent" setting on (the default). This started with #23744, which is not in any release yet. macOS, Linux, SSH hosts, and ordinary Windows (NTFS) files are not affected.
Why it happened. Orca writes the guest file from Windows through
\\wsl.localhost\<distro>\...: it writes a temporary file beside it, then renames that over the original. Windows cannot read or set Linux permission bits through that share. Node reports a made-up 0o666 for any writable file there, the writer skippedchmodon Windows, and the guest gives every file created through the share its default 0644. The rename then replaced the 0600 original with that 0644 file.The fix. Before taking Claude's lock, the writer now creates the empty temporary file first. When the config lives in a WSL guest, it then runs one
chmod --reference=<original> -- <temporary file>inside the distro, through Orca's existingrunWslProcess(wsl.exe --exec, no shell, never thewsl.exe --form). After that, as before, it reads, merges and renames synchronously under Claude's lock. It writes into the prepared file without recreating it, so the replacement arrives with the original's exact mode. Native files go through the same create-then-fill order with the same mode handling as before, with one narrow difference: a native config its owner cannot write (0400/0444, or the Windows read-only attribute) is now skipped and Claude asks, where main replaced it.What stays the same. Claude's lock is still taken and never broken. The file is never created. On macOS, Linux and native Windows, symlinks are kept, because the write goes to the link's target. A symlinked
~/.claude.jsoninside a WSL guest cannot be read from Windows at all, so Orca skips it and Claude asks, the same as on main. A failure never blocks the launch: if the guest cannot copy the mode, Orca writes nothing, logs[agent-trust] claude trust for <folder> failed; the agent will ask, and Claude shows its trust prompt as it did before #23744. (If the write takes longer than the 1.5 s the launch waits for it, Orca logs only its existingdid not settle within 1500mswarning; the outcome is the same.)Other writers. Claude's is the only trust writer #23744 sends into a WSL guest; Codex, Cursor and the rest skip WSL launches. Orca's Claude login writer only writes the Windows host's own file. Nothing else in Orca writes a guest
~/.claude.json.Why
Alternatives considered and rejected:
statthe mode before,chmodafter the rename. The file is world-readable between the rename and thechmod, and stays that way if thechmodfails, which is this bug again on the failure path.The chosen order fails closed: the mode is set before the file is replaced, and any failure means no write.
Cost: one short
wsl.exe --exec chmodper trust write that is actually due, which is the first Orca-started Claude in a new WSL worktree. It runs before Claude's lock is taken, so the lock is still held only for the synchronous read, merge and rename. Measured on the Windows test machine with the distro running: a granted write takes 84 ms on this branch vs 22 ms on main (median of 5), well inside the 1.5 s the launch waits for a trust write. An already-trusted folder starts nowsl.exe. When Claude's lock is held, thechmodstill runs (about 60 ms) and nothing is written.chmod --referenceis GNU coreutils. On a BusyBox distro such as Alpine it fails, so Orca writes nothing and Claude asks, the same as before #23744.Linked Issue
None. Found in post-merge QA of #23744 (Windows with WSL Ubuntu 24.04).
Visual Proof
Nothing on screen changes; the fix is a file's permission bits. Live measurement from a pane of this branch's dev build on the Windows test machine (WSL Ubuntu-24.04), scratch config, main's writer vs this branch's writer: main turns the 0600 file into 0644, this branch keeps 0600; an ordinary NTFS config is unchanged on both.
End-to-end on Windows + WSL
Owner-approved run on the Windows test machine (WSL Ubuntu-24.04), against the guest user's real
~/.claude.json. The earlier QA of #23744 had left that file at 0644, so it was set back to 0600 first. Orca was built from this PR's head31811020f3fin a fresh worktree and run in the background with its own profile (trust setting on, no managed Claude account). A throwaway WSL repo got an Orca worktree, and Claude 2.1.285 was started from Orca's new-tab launch.PONGto an inert message.projectsgained the new worktree's key withhasTrustDialogAccepted: true. Claude itself also added its usual entry for the repo's main checkout (hasTrustDialogAccepted: false; Orca only ever writestrue, and the same entry appeared in the feat(agents): pre-trust the folder wherever Orca starts an agent #23744 QA). No key was removed: 30 top-level keys before and after, and every earlierprojectskey is still there..orca-trust-*.tmpfile and no.claude.json.lock.claude-folder-trust-file.tsswapped to main's9be71d0b6dfand the rig rebuilt, a Claude start in a fresh worktree turned the same 0600 file into 0644. The file was set back to 0600 afterwards.~/.claude/settings.jsonand~/.codex/hooks.jsonstayed byte-identical. The guest's~/.codex/config.tomlkept the same bytes but was rewritten at rig start by Orca's Codex hook-trust grant; every earlier rig on this machine did the same, and it is unrelated to this PR. On the Windows side only the user's~/.claude.jsonchanged (same size, new content). It was byte-identical right after the first rig start, and 12 other Windows Claude sessions were running on that machine, so the change is not attributed to this run.Testing
New
src/main/claude/claude-folder-trust-file-wsl-guest.test.tsmodels Windows Node over\\wsl.localhost: a made-up 0o666 mode, achmodthat cannot reach the guest bits, and new files created at the guest's default 0644. It runsgrantClaudeFolderTruston a 0600 guest file. On main it fails withexpected 420 to be 384(0644 instead of 0600); with this change it passes. A second case shows that a failed guestchmodleaves the file, its mode and its folder untouched.Existing writer and trust tests pass: 11 files, 226 tests (
claude-folder-trust-file,execution-host-workspace-trust,agent-workspace-trust*,spawn-options-agent-workspace-trust, the relay trust tests, and the structured-session create intent test).pnpm tc:node, oxlint andcheck:code-quality:changedpass. The SSH relay bundle still builds (the relay shares this file).Live on the Windows high spec machine with WSL Ubuntu-24.04, on scratch files only, never the real
~/.claude.json. This branch's writer and main's were bundled and run from Windows Node the way Orca calls them:resolveLocalClaudeTrustConfigwith a WSL auth preparation, thengrantClaudeWorkspaceTruston a\\wsl.localhostpath.600 -> 644, trust entry written.600 -> 600, trust entry written, no temporary file left behind.Review QA, same machine, bundles of
31811020f3fvs main9be71d0b6df, scratch files only:locked, file and mode unchanged, no temporary file. Already trusted:unchanged, byte-identical, nowsl.exe.chmodfailure: nothing written, no temporary file, and the launch helper logs[agent-trust] claude trust for <folder> failed; the agent will ask.unreadableon both builds (Windows cannot read guest symlinks), so nothing is written and Claude asks.chmodtest.End-to-end through an Orca-started Claude on the real guest file: passed. See "End-to-end on Windows + WSL" above.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Security: closes a permission widening on a file holding account details. Cross-platform: the new path runs only for a
\\wsl.localhost/\\wsl$config; macOS, Linux and native Windows keep their existing mode handling. SSH: the relay shares the writer but never resolves a WSL guest path. No wire, persisted-data or UI change.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)