Skip to content

feat: auto-mount ~/.claude/ directory into sandboxes - #179

Open
Abhijitam01 wants to merge 1 commit into
gofixpoint:mainfrom
Abhijitam01:Abhijitam01/auto-copy-claude-config
Open

feat: auto-mount ~/.claude/ directory into sandboxes#179
Abhijitam01 wants to merge 1 commit into
gofixpoint:mainfrom
Abhijitam01:Abhijitam01/auto-copy-claude-config

Conversation

@Abhijitam01

@Abhijitam01 Abhijitam01 commented Apr 25, 2026

Copy link
Copy Markdown

Summary

  • Auto-mount ~/.claude/ directory into sandbox containers at /home/amika/.claude/ using rwcopy mount mode, preserving Claude Code configuration (model settings, thinking mode, session state)
  • Add --no-claude-config CLI flag to opt out of mounting the .claude/ directory while still mounting other agent configs (OpenCode, Codex)
  • Implement mount overlap resolution: when .claude/ dir is mounted, individual credential file mounts inside it (e.g., .claude/.credentials.json) are automatically deduplicated via filterOutSubpaths()

Changes

internal/agentconfig/agentconfig.go

  • Add dirMount() helper for directory-level mount discovery
  • Add ClaudeConfigDirMount() to return mount spec for ~/.claude/ directory
  • Update AllMounts() with deduplication logic to prevent double-mounting
  • Add AllMountsWithoutClaudeConfig() for --no-claude-config flag support
  • Add filterOutSubpaths() helper to filter out file mounts covered by parent directory mount

cmd/amika/sandbox/command.go

  • Add --no-claude-config flag to sandbox create command

cmd/amika/sandbox/sandbox_create.go

  • Wire --no-claude-config flag through to collectMounts()

cmd/amika/sandbox/sandbox_create_materialize.go

  • Accept noClaudeConfig parameter in collectMounts()
  • Conditionally select AllMounts() vs AllMountsWithoutClaudeConfig() based on flag

internal/agentconfig/agentconfig_test.go

  • 7 new test cases: TestClaudeConfigDirMount_Exists, _NotExists, _FileNotDir, TestAllMounts_WithClaudeDir, _WithoutClaudeDir, TestFilterOutSubpaths, TestAllMountsWithoutClaudeConfig

Test plan

  • make fmt && make vet && make lint && make build — all pass
  • All 21 agentconfig unit tests pass (14 existing + 7 new)
  • Manual: amika sandbox create --preset claude → verify ls /home/amika/.claude/ shows directory contents
  • Manual: amika sandbox create --preset claude --no-claude-config → verify .claude/ dir not present

Closes #160

…-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.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@dbmikus

dbmikus commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Hey, just wanted to say thanks for your contributions. We'll get to reviewing them! Underwater with a few other things right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-copy local .claude/ directory into sandbox VMs

2 participants