Skip to content

Fix duplicate mount when YOLO_PODMAN_VOLUMES contains workspace or claude dir - #84

Open
yarikoptic-gitmate wants to merge 1 commit into
mainfrom
claude/yolo-dedup-mounts-j12ybf
Open

yarikoptic-gitmate wants to merge 1 commit into
mainfrom
claude/yolo-dedup-mounts-j12ybf

Conversation

@yarikoptic-gitmate

Copy link
Copy Markdown

Summary

When a directory listed in YOLO_PODMAN_VOLUMES (user-wide or per-project config) happens to be the current working directory or ~/.claude, podman rejects the run with:

Error: /home/yoh/proj/CON/skills: duplicate mount destination

This is because the workspace and claude mounts are added unconditionally by the script, and the config volumes were added earlier — before the final mount destinations were known — so there was no opportunity to deduplicate.

Fix: collect config volumes into _CONFIG_VOLS first, then after WORKSPACE_DIR and CLAUDE_DIR are determined, add each volume only if its container destination does not conflict with either of those two mounts. Conflicting entries emit a warning to stderr and are silently skipped (the directory is still mounted via the fixed workspace/claude mount).

Test plan

  • Three new bats tests: workspace-dir conflict, claude-dir conflict, mixed (conflict skipped + non-conflicting volume still present)
  • Rebuild container image to pick up Claude Code ≥ 2.1.274 (separate from this PR — fixes bash prompts appearing despite --dangerously-skip-permissions)

…pace or claude dir

When a user's config (user-wide or per-project) lists a directory that
matches the current working directory or ~/.claude, podman rejects the
run with "duplicate mount destination". This happened in practice when
running yolo from a directory that was also listed in YOLO_PODMAN_VOLUMES
(e.g. ~/proj/CON/skills in the user config while invoking yolo from that
directory).

Defer adding config volumes to PODMAN_ARGS until after WORKSPACE_DIR and
CLAUDE_DIR are known, then skip any volume whose container destination
matches either of those two mounts, emitting a warning to stderr.

Co-Authored-By: Claude Code 2.1.275 / Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants