feat(cli): default claude/opencode to sandbox mount with git included - #31
Merged
Merged
Conversation
Bumps @relayfile/local-mount to ^0.6.0 and passes includeGit: true so the per-session mount carries .git, letting agents run git inside the sandbox. Tracked paths matching the hidden patterns (CLEAN_IGNORED_*, SKILL_INSTALL_IGNORED_*, persona configFile paths) are flagged skip-worktree and added to .git/info/exclude inside the mount, so git status doesn't report them as deleted/untracked. The mount's .git is per-session and noSyncBack, so this state is sandboxed. Flips the claude branch in decideCleanMode to mirror opencode: mount engages by default, --install-in-repo opts out. Removes the legacy --clean flag entirely (mount is now the default behavior on both harnesses; codex is unchanged). Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
@relayfile/local-mountto^0.6.0and setsincludeGit: trueon thelaunchOnMountcall, so the per-session mount carries.gitand agents can run git inside the sandbox. Per relayfile 0.6's contract this is one-way project→mount sync — host.gitmutations flow in, but mount-side commits/refs are sandboxed and discarded on cleanup, so the agent mustgit pushto persist work.configureGitForMount(called fromonBeforeLaunch) which configures the mount's per-session.gitso paths hidden by the relayfile mount don't show up as deleted/untracked. Specifically:git update-index --skip-worktreeon tracked files matching the hidden patterns, plus the patterns appended to.git/info/exclude. Uses git's own gitignore matcher (ls-files -i --exclude-from) to pick the targets, keeping semantics aligned with relayfile's filter.decideCleanModeto mirror opencode: mount engages by default,--install-in-repoopts out. The legacy--cleanflag is removed entirely (no back-compat).parseAgentArgs,AgentFlags, the--clean/--install-in-repoconflict check, and the codex--cleanwarning all go away. Codex sessions are unchanged — they never mount.packages/cli/README.md) to describe the new default; the "Clean mode" section becomes "Sandbox mount" and documents both the claude (CLAUDE.md,.claude,.mcp.json) and opencode (skill-install pollution) hidden patterns plus the includeGit semantics.Why this shape
@relayfile/local-mount0.6.0 (release notes) introducedincludeGitas one-way project→mount sync, which is exactly the property we want — agents see real.gitstate, but mount-side mutations can't poison the host repo. The remaining piece was makinggit statusnot lie inside the sandbox, since the working tree omits the hidden patterns by design but git would otherwise report them as deleted. Skip-worktree +info/excludeis the standard idiom for that, and both writes are scoped to the sandboxed.gitso nothing leaks back to the user's main checkout.Test plan
corepack pnpm run check— typecheck + 51 cli tests pass (added:buildMountGitExcludeBlockformatting,configureGitForMountintegration test against a real tmp git repo, no-op cases; updateddecideCleanModeandparseAgentArgstests for the simpler signatures).agent-workforce agent posthog@bestfrom inside the workforce repo, verifygit statusinside the session shows a clean tree (no spurious deleted CLAUDE.md / .claude entries) and that an in-mount commit +git pushlands on the remote.--install-in-repostill disengages the mount and runs against the real cwd.🤖 Generated with Claude Code