Skip to content

Latest commit

 

History

History
86 lines (62 loc) · 2.26 KB

File metadata and controls

86 lines (62 loc) · 2.26 KB

claudeway - Answer to the Ultimate Question of Securing Claude Code Execution


A CLI tool for safely running AI coding agents like Claude Code inside a Docker container.

日本語版はこちら

How it works

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

Installation

go install github.com/common-creation/claudeway@latest

Usage

Initial Setup

# Initialize global settings and Docker assets
claudeway init --global

# Initialize project-specific settings
claudeway init

Basic Usage

# 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

Other Commands

# Build the Docker image
claudeway image build

# Build the image without cache
claudeway image build --no-cache

Configuration File

Format 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 Code

For a real-world example, please check claudeway.yaml.