Docker Sandbox + Claude - missing plugins, rules, user-level config such as CLAUDE.md

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.

Thanks for the quick reply.

~/.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

You mean it is missing from the image when you run a container using docker run or it is missing when you run a sandbox based on the custom template?

Or maybe you had an error?

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.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.