Skip to content

[BUG] default and sandbox variants don't share volumes (Compose project-name prefix) #209

Closed

Description

@gatezh

Summary

The README says the default and sandbox variants share node_modules, Claude config, zsh history and gh/cf logins ("Install packages in one variant and both benefit"; "Sign in once in the default variant"). They don't. The devcontainer CLI passes mounts to Compose as service volumes, and Compose prefixes every non-external named volume with the project name. The two variants have different project names (myproject vs myproject-sandbox), so each gets its own set of volumes, and sandbox auth via the shared ~/.claude volume never works.

Reproduction

  1. Open the default variant, then the sandbox variant, for the same project.
  2. docker volume ls:
myproject_myproject-claude-config-<folder>
myproject-sandbox_myproject-claude-config-<folder>

Verification

docker volume ls -q | grep claude-config

shows two volumes per project, one per compose project name.

Suggested fix

Options: (a) give both variants the same compose name: (they'd then share a compose project — check that opening one doesn't recreate/stop the other's container, since the service name is also devcontainer in both), or (b) declare the volumes in each docker-compose.yml with an explicit name: (and external: false) so Compose doesn't prefix them — at the cost of ${localWorkspaceFolderBasename} interpolation, which Compose can't see. Or (c) correct the README to say volumes are per-variant and sandbox needs CLAUDE_CODE_OAUTH_TOKEN.

Affected files in this repo

  • claude-code/.devcontainer/docker-compose.yml:1
  • claude-code/.devcontainer/claude-sandbox/docker-compose.yml:1
  • claude-code/README.md ("Shared volumes", "Sandbox Authentication")

Related

Activity

  1. gatezh commented on Oct 22, 2026

    @gatezh
    OwnerAuthor

    Fixing the cause rather than the README: #236 moves the volumes into docker-compose.yml with fixed name:s so both variants share them.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions