feat: auto-mount ~/.claude/ directory into sandboxes - #179
Open
Abhijitam01 wants to merge 1 commit into
Open
Conversation
…-config flag Mount the entire ~/.claude/ directory into sandbox containers at /home/amika/.claude/ using rwcopy mode, preserving Claude Code configuration (model settings, thinking mode, session state). Add --no-claude-config CLI flag to opt out while still mounting other agent configs (OpenCode, Codex). Implement mount overlap resolution to prevent double-mounting individual credential files already covered by the parent directory mount.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
|
Hey, just wanted to say thanks for your contributions. We'll get to reviewing them! Underwater with a few other things right now. |
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
~/.claude/directory into sandbox containers at/home/amika/.claude/using rwcopy mount mode, preserving Claude Code configuration (model settings, thinking mode, session state)--no-claude-configCLI flag to opt out of mounting the.claude/directory while still mounting other agent configs (OpenCode, Codex).claude/dir is mounted, individual credential file mounts inside it (e.g.,.claude/.credentials.json) are automatically deduplicated viafilterOutSubpaths()Changes
internal/agentconfig/agentconfig.godirMount()helper for directory-level mount discoveryClaudeConfigDirMount()to return mount spec for~/.claude/directoryAllMounts()with deduplication logic to prevent double-mountingAllMountsWithoutClaudeConfig()for--no-claude-configflag supportfilterOutSubpaths()helper to filter out file mounts covered by parent directory mountcmd/amika/sandbox/command.go--no-claude-configflag tosandbox createcommandcmd/amika/sandbox/sandbox_create.go--no-claude-configflag through tocollectMounts()cmd/amika/sandbox/sandbox_create_materialize.gonoClaudeConfigparameter incollectMounts()AllMounts()vsAllMountsWithoutClaudeConfig()based on flaginternal/agentconfig/agentconfig_test.goTestClaudeConfigDirMount_Exists,_NotExists,_FileNotDir,TestAllMounts_WithClaudeDir,_WithoutClaudeDir,TestFilterOutSubpaths,TestAllMountsWithoutClaudeConfigTest plan
make fmt && make vet && make lint && make build— all passamika sandbox create --preset claude→ verifyls /home/amika/.claude/shows directory contentsamika sandbox create --preset claude --no-claude-config→ verify.claude/dir not presentCloses #160