Docker Sandbox for isolating AI coding agents is a great idea and I was excited to try it.
However, in its current version it has a major shortcoming - the setup completely ignores my user-level claude configuration, including all my installed plugins, skills, commands, rules, hooks, etc.
Even if I add a RO mount of my ~/.claude folder, it will not recognize it there because the HOME env was pointed to a different user directory where some Sandbox-specific Claude config was created.
So what I need to do now in order to actually work, is to move all my Claude setup into the correct places in the sandbox.
I am going to create a template for it, since thatâs the only way I will be able to work on my multiple projects.
But I think this use case is so basic that it canât be ignored - you donât expect your users to forget about all their existing Claude setup and plugins in order to try your product.
Hello, Docker Sandboxes run the agent inside a sandbox VM as a separate non-root agent user, so the sandbox has its own $HOME (typically /home/agent) and its own user-level config space.
Today, docker sandbox run is documented to mount your workspace (and optional extra workspaces) at the same absolute path inside the sandbox; it doesnât describe a supported way to remap a host folder like ~/.claude directly to $HOME/.claude inside the sandbox.
So a read-only mount of your host ~/.claude may not be discovered by Claude Code if itâs not located under the sandbox userâs $HOME.
Supported workaround (documented): If you need your Claude setup (plugins/rules/hooks) available consistently, the current documented approach is to create a custom template:
either build one from docker/sandbox-templates:claude-code, or
configure a sandbox once and reuse it by saving it as a template (docker sandbox save).
Product feedback: I agree this is a common workflow expectation (reuse host agent config). If you can share a minimal summary of what should be imported (e.g., ~/.claude contents) and whether it must be read-only vs read/write, it would be good feedback for the Sandboxes team.
~/.claude content is an obvious minimum, and it should be properly merged with whatever you predefined in the Sandbox to make things work smoothly.
I donât know a single developer who works with Claude bare bones without some plugins or config.
I believe that organizations might have more requirements, such as merging the root config as well (./claude for all users).
Yes, I was going to work on a template since I donât have a better solution, but I think this should come out of the box.
Also, I noticed that the Sandbox Claude initial setup doesnât have even the official Anthropic plugins market.
Sorry in advance, this might have an obvious solution but how can I create a Dockerfile with a custom .claude folder? I want to customize settings.json in this instance. I canât seem to create it with the Dockerfile below. Docker Sandbox always overrides it with its own settings.json file.
FROM docker/sandbox-templates:claude-code
USER root
RUN curl -fsSL https://deb.nodesource.com/setup_25.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g corepack \
&& corepack enable pnpm
COPY ./settings.json /home/agent/.claude/settings.json
RUN chown -R agent:agent /home/agent/.claude
USER agent
I didnât get an error. I can see my settings.json file inside the container when I run it using docker run, but itâs missing when I run the template using the --template flag. Docker probably overrides my config.
I found time again to look into some unanswered topics and tried to add a custom settings based on your shared Dockerfile. It looks like claude overrides the settings file. So I checked the output of claude --help in the sandbox container and found this:
agent@test:~/workspace$ claude --help | grep setting
--verbose Override verbose mode setting from config
--settings <file-or-json> Path to a settings JSON file or a JSON string to load additional settings from
--setting-sources <sources> Comma-separated list of setting sources to load (user, project, local).
So you could copy the exra settings file to another location and pass the settings option when creating the sandbox
docker sandbox run --template mytemplate claude . -- --settings /home/agent/.claude/custom-settings.json
That will not be changed. Of course then you could copy the settings.json to the already mounted working directory. without copying the file to the image.
If you want to change the parameters in the Dockerfile, you could try changing the entrypoint of the image. Not the CMD, because that is overridden. I tried and the parameters were added, but the sandbox container stopped quickly due to docker socket permission errors so that could be an independent error. I donât have more time to test it currently, but I will share if I find out anything new.