Run Claude Code autonomously in sandboxed Docker containers with git worktree isolation.
You describe what you want built. Claude implements it in an isolated container, iterates on quality gates (build, lint, test, code review), and produces a branch ready for PR.
spec → execute → status → ship → clean
- Docker
- Claude CLI (
npm install -g @anthropic-ai/claude-code) ANTHROPIC_API_KEYenvironment variable
From release binary (recommended):
# Download from GitHub Releases
# https://github.com/dakaneye/claude-sandbox/releases/latest
# macOS arm64
curl -L https://github.com/dakaneye/claude-sandbox/releases/latest/download/claude-sandbox_$(curl -s https://api.github.com/repos/dakaneye/claude-sandbox/releases/latest | grep tag_name | cut -d'"' -f4 | sed 's/v//')_darwin_arm64.tar.gz | tar xz
mv claude-sandbox /usr/local/bin/From source:
go install github.com/dakaneye/claude-sandbox/cmd/claude-sandbox@latestContainer image (auto-pulled on first execute):
# Pulled automatically, or manually:
docker pull ghcr.io/dakaneye/claude-sandbox:latest
# Or build locally (requires apko):
claude-sandbox buildexport ANTHROPIC_API_KEY=sk-ant-...
# 1. Create a session — launches interactive Claude for planning
claude-sandbox spec --name my-feature
# 2. Execute — Claude implements the spec in a container
claude-sandbox execute
# 3. Check progress
claude-sandbox status
# 4. Review and create PR
claude-sandbox ship
# 5. Clean up
claude-sandbox clean| Command | Description |
|---|---|
spec |
Create worktree + session, launch Claude for planning |
execute |
Run Claude in container to implement the spec |
status |
Show session status with progress analysis |
list |
List all sessions (alias: ls) |
ship |
Review COMPLETION.md and create PR |
stop |
Stop a running container |
clean |
Remove sessions and worktrees |
build |
Build the sandbox container image |
claude-sandbox spec --name my-feature # auto-generated branch
claude-sandbox spec --name my-feature --branch dakaneye/my-feature # custom branchCreates a git worktree and launches Claude interactively. Use /brainstorming and /writing-plans skills to create a PLAN.md. Session is marked "ready" when PLAN.md exists.
claude-sandbox execute # uses active session
claude-sandbox execute --session my-feature # specific sessionRuns Claude in a Docker container with the worktree mounted. Claude reads PLAN.md and iterates until all quality gates pass. Progress is logged to ~/.claude/sandbox-sessions/<id>.log.
claude-sandbox statusShows session info, timestamps, and — for running sessions — uses Claude Haiku to analyze the log and estimate progress (phase, current activity, % to completion).
claude-sandbox list # or: claude-sandbox lsID NAME BRANCH STATUS AGE
*2026-03-27-be10a5 my-feature dakaneye/my-feature running 12m
2026-03-27-f8258f token-work sandbox/2026-03-27-7d9a8f success 3h
claude-sandbox ship
claude-sandbox ship --skip-review # skip COMPLETION.md review prompt
claude-sandbox ship --keep-worktree # don't clean up after shippingValidates COMPLETION.md shows success, opens it for review, then launches Claude with /create-pr to create the pull request.
- spec creates a git worktree (isolated branch) and launches Claude interactively to plan the work into
PLAN.md - execute spins up a Docker container with the worktree mounted, runs Claude with
--dangerously-skip-permissionsinside the container, and streams output to a log file - Claude reads the plan, implements it, and iterates on quality gates (build, lint, test,
/review-codegrade A) until done - Claude writes
COMPLETION.mdwith the final status - ship validates completion and creates a PR via Claude on the host
The container has controlled mounts (worktree read-write, git config read-only, Claude settings pre-baked) and passes ANTHROPIC_API_KEY via environment inheritance.
For private repo access inside the container, set GITHUB_TOKEN:
export GITHUB_TOKEN=$(gh auth token) # or use octo-sts for scoped tokens
claude-sandbox executeThe token is passed to the container and configured as a git credential helper scoped to github.com only. See examples/octo-sts-policy.yaml for an Octo STS trust policy example.
Claude is prompted to pass these gates before writing COMPLETION.md:
make buildorgo buildgolangci-lint rungo test ./.../review-codegrade A
These are advisory — Claude is instructed to follow them but enforcement is prompt-based. Always review changes before shipping.
The container image is signed with Sigstore keyless signing and includes an SBOM and SLSA provenance attestation.
# Verify image signature
cosign verify ghcr.io/dakaneye/claude-sandbox:latest \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp 'github.com/dakaneye/claude-sandbox'
# Download SBOM
cosign download sbom ghcr.io/dakaneye/claude-sandbox:latest | jq .
# Verify SLSA provenance
cosign verify-attestation ghcr.io/dakaneye/claude-sandbox:latest \
--type slsaprovenance \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp 'github.com/dakaneye/claude-sandbox'MIT