Container Entrypoint Flow
Each container runs an entrypoint.sh that sets up the environment before handing off to Claude Code.
Builder (images/builder/entrypoint.sh)
- Validate env vars:
GIT_TOKEN,REPO_URL,ISSUE_URL,SPEC_PATH - Attempt iptables egress allowlist (skipped in rootless mode — see networking.md)
- Fix
~/.claudeownership for session data writes - Pre-flight check: verify
GIT_TOKENhas push access toREPO_URLvia GitHub API - Configure git auth (url.insteadOf + token exports)
- Build prompt with spec path, repo URL, issue URL
- Exec Claude Code as
claudeuser (viagosuor direct exec in rootless)
Max turns: 80. Tools: Read, Write, Edit, Bash, Glob, Grep.
Reviewer (images/reviewer/entrypoint.sh)
- Validate env vars:
GIT_TOKEN,REPO_URL,PR_URL - Attempt iptables egress allowlist
- Fix
~/.claudeownership - Configure git auth
- Build prompt with PR URL and repo URL
- Exec Claude Code — read-only (no Write/Edit tools)
Max turns: 25. Tools: Read, Bash, Grep, Glob.
Security Reviewer (images/security/entrypoint.sh)
- Validate env vars:
GIT_TOKEN,REPO_URL,PR_URL - Attempt iptables egress allowlist
- Fix
~/.claudeownership - Clone the PR branch into
/workspace/repo - Run SAST tools before Claude starts:
- Semgrep (
p/security-audit,p/secrets,p/owasp-top-ten) →/tmp/semgrep-results.json - Gitleaks →
/tmp/gitleaks-results.json - Trivy (conditional: Dockerfile →
fsscan, Helm/K8s →configscan) →/tmp/trivy-results.json
- Semgrep (
- Configure git auth
- Build prompt referencing the pre-computed SAST results
- Exec Claude Code — read-only
Max turns: 20. Tools: Read, Bash.
gosu fallback
In real-root environments (K8s, rootful Docker/Podman), gosu drops privileges to the
claude user. In rootless mode, container "root" is already the host user — gosu setuid
fails, so the entrypoint falls back to exec directly.