A CLI tool for safely running AI coding agents like Claude Code inside a Docker container.
It starts a Docker container by bind-mounting the current directory.
At this time, it inherits the host's environment variables (dotenv friendly) with a few exceptions, initializes the container according to the configuration file, and executes with the same UID and GID as the host.
This prevents catastrophic damage to the host, even if the AI coding agent were to execute rm -rf --no-preserve-root /.
go install github.com/common-creation/claudeway@latest# Initialize global settings and Docker assets
claudeway init --global
# Initialize project-specific settings
claudeway init# Start the container and enter an interactive shell
claudeway up
# Enter an interactive shell of an already running container
claudeway exec
# Stop and remove the container
claudeway down# Build the Docker image
claudeway image build
# Build the image without cache
claudeway image build --no-cacheFormat of claudeway.yaml:
# Volume mount settings
bind:
- /var/run/docker.sock:/var/run/docker.sock # Docker socket
- ~/.claude.json:~/.claude.json # Claude settings
- ~/.claude:~/.claude # Claude directory
# Files to copy into the container
copy:
- ~/.gitconfig # Git settings
- ~/.ssh # SSH keys
# Initialization commands (executed on container start)
init:
- curl -Ls get.docker.com | sh # Install Docker
- asdf plugin add nodejs # Add Node.js plugin
- asdf install nodejs 22.17.0 # Install Node.js
- asdf global nodejs 22.17.0 # Set default version
- npm i -g @anthropic-ai/claude-code # Install Claude CodeFor a real-world example, please check claudeway.yaml.
