A portable, containerized environment for running Claude Code from anywhere on your system
Because it just feels better with protection.
- 🐳 Fully containerized - No local installation required (except Docker)
- 📁 Directory mounting - Automatically mounts your current working directory
- ⚙️ Config preservation - Uses your existing
~/.claude.jsonconfiguration - 🛠️ Pre-configured - Includes Node.js, pnpm, git, bash, and vim
- 🚀 Portable - Run from any directory with a single command
# Clone the repository
git clone <your-repo-url>
cd claude-container
# Run the installer
./install.sh
# Start using it from any directory
cd ~/my-project
claude-container- Docker Desktop (or Docker Engine)
- A configured
~/.claude.jsonfile with your Claude Code API key
Run the installer script which will handle everything for you:
./install.shThe installer will:
- Check if Docker is running
- Build the Docker image if needed
- Install the wrapper script (system-wide or user-local)
- Set up permissions automatically
Click to expand manual installation steps
docker build -f Dockerfile.utility -t claude-container:latest .System-wide (requires sudo):
sudo cp claude-container /usr/local/bin/
sudo chmod +x /usr/local/bin/claude-containerUser-local (no sudo):
mkdir -p ~/bin
cp claude-container ~/bin/
chmod +x ~/bin/claude-container
export PATH="$HOME/bin:$PATH" # Add to ~/.bashrc or ~/.zshrcclaude-container versionNavigate to any project directory and run:
claude-containerThis launches a Docker container with:
- Your current directory mounted at
/workspace - Your
~/.claude.jsonconfiguration loaded - Claude Code CLI automatically started
Claude Code will start immediately, allowing you to interact with the AI agent. When you're done, exit Claude Code and the container will be automatically removed.
Edit Dockerfile.utility to add more packages:
RUN apk add --no-cache \
bash \
vim \
jq \
python3 \
your-tool-hereThen rebuild:
docker build -f Dockerfile.utility -t claude-container:latest .Edit the claude-container script to add volume mounts:
# Example: Mount SSH keys and Git config
-v "$HOME/.ssh:/root/.ssh:ro" \
-v "$HOME/.gitconfig:/root/.gitconfig:ro" \Image not found error
Build the Docker image:
docker build -f Dockerfile.utility -t claude-container:latest .Docker is not running
Start Docker Desktop or your Docker daemon before running the container.
Shell crashes after trust prompt
Try rebuilding with the latest version:
docker build --no-cache -f Dockerfile.utility -t claude-container:latest .Or check your config file permissions:
chmod 644 ~/.claude.jsonChanges don't persist
This is expected. Only files in the mounted /workspace directory (your current directory) persist. The container itself is ephemeral.
Permission issues with files
Ensure your Docker daemon is configured to map your user ID correctly. This is usually automatic on Docker Desktop.
Run the automated uninstaller:
./uninstall.shOr manually:
# Remove the script
sudo rm /usr/local/bin/claude-container
# or
rm ~/bin/claude-container
# Remove the Docker image
docker rmi claude-container:latestUse the release script to create new versions:
./release.sh 1.0.1This will:
- Validate the version format (semantic versioning)
- Update the version in
claude-container - Create a git commit and tag
- Prompt you to push changes
Push the release:
git push origin main --tagsContributions are welcome! Please feel free to submit a Pull Request.
MIT License - See LICENSE file for details
Built for use with Claude Code by Anthropic.