640 B
640 B
isolated-claude-code
Isolated Claude Code container will mount the current working directory into the container and execute CC. Mounting a host directory to store Claude's configurations files ensure persistency between container.
- Build the docker image.
docker build -t claude-code - Run the container
docker run --rm -it -v "$(git rev-parse --show-toplevel 2>/dev/null || pwd)":/app -v "$HOME/.claude":/root/.claude claude-code
You can also add a shell alias:
alias claude='docker run --rm -it \
-v "$(git rev-parse --show-toplevel 2>/dev/null || pwd)":/app \
-v "$HOME/.claude":/root/.claude \
claude-code'