Run Claude Code autonomously inside a Docker container. The container is the sandbox — full permissions inside, scoped credentials outside.
- Create .env from template:
cp .env.template .env(fill in GITHUB_TOKEN, GT_AUTH_TOKEN) - Build:
docker compose build - Run:
./scripts/run.sh(auto-extracts Claude credentials from macOS keychain) - One-shot task:
./scripts/run.sh claude -p "Fix the typo in README.md" --max-turns 5
- Container = sandbox:
--dangerously-skip-permissionsis safe because the container boundary prevents host damage - No network firewall: Full outbound network access — WebFetch, npm install, cargo build, pip install, go get all work without restriction
- Repos mounted from host via volume mount: Claude uses
--worktreeflag to isolate changes — your working tree stays untouched - Credentials scoped: Fine-grained GitHub PAT + Graphite token injected at runtime
- Safety model: Container isolation + scoped credentials + GitHub branch protection. The container can't touch the host, tokens are least-privilege, and branch protection prevents direct pushes to main
| File | Purpose |
|---|---|
Dockerfile |
Full toolchain: Node, Rust, Go, Python, gh, gt, Claude Code |
docker-compose.yml |
Volume mounts, env vars, resource limits |
entrypoint.sh |
Configures git, gh, gt auth from env vars |
scripts/run.sh |
Extracts Claude credentials from host keychain and launches |
claude-config/settings.json |
Bypass permissions (container is the sandbox) |
claude-config/CLAUDE.md |
Autonomous mode instructions |
.env.template |
Template for secrets |
Default: 8GB memory, 4 CPUs. Adjust in docker-compose.yml if cargo/go builds need more.