# coderluii/holyclaude architecture

> Architecture diagram of the GitHub repository coderluii/holyclaude, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/coderluii/holyclaude
- Repository: https://github.com/coderluii/holyclaude

## Overview

#### Purpose and Entry Points
HolyClaude builds and publishes a self-hosted Docker development workstation: CloudCLI’s browser UI fronts Claude Code and other AI CLIs, with a persistent workspace, browser automation, and optional remote shell access. Main user entry points are `docker-compose.yaml` (quick Docker), `docker-compose.full.yaml` (full configuration), and `docker-compose.podman-rootless.yaml` (rootless Podman). Image construction begins in `Dockerfile`.

#### Image Assembly and Release Contract
The Dockerfile creates full and slim variants, installs runtimes/tools, and bakes patched CloudCLI plus browser support into the image. Release-sensitive versions and expected image properties are declared as a machine-readable contract and checked against build/Compose inputs.
- `Dockerfile`
- `contracts/product-facts.json`
- `contracts/product-facts.v1.schema.json`

Security backports and patch scripts modify upstream CloudCLI/package/browser behavior during build rather than at runtime. Immutable-input and advisory policy artifacts constrain release supply-chain decisions.
- `security/immutable-inputs.yml`
- `scripts/patch-cloudcli-browser-runtime.mjs`
- `scripts/build-cryptography-security-backport.sh`

#### Container Lifecycle and Persistent State
The container starts through a privileged lifecycle script that handles Docker UID/GID remapping, restores Claude session state, prepares persistent Git/GitHub configuration, and delegates long-running processes to s6. First boot copies default Claude settings/memory into the mounted `.claude` directory without overwriting later user changes.
- `scripts/entrypoint.sh`
- `scripts/bootstrap.sh`
- `scripts/persist-claude-json.mjs`

The key persistence boundary is host-mounted `/home/claude/.claude` for credentials/settings and `/workspace` for projects. CloudCLI’s SQLite account store is container-local by default; it can use a local Docker named volume but should not reside on network filesystems.

#### Supervised Runtime Services
s6-overlay is PID 1 and controls independent runtime services: CloudCLI, Xvfb, Claude-session persistence, and opt-in SSH. This separates boot-time state repair from restartable service processes and ensures signal forwarding and child reaping.
- `s6-overlay/s6-rc.d/cloudcli/run`
- `s6-overlay/s6-rc.d/xvfb/run`
- `s6-overlay/s6-rc.d/sshd/run`

CloudCLI listens on container port 3001 and is the browser-facing control plane for Claude Code, projects, plugins, and web terminal access. It launches as the non-root `claude` user with `/workspace` as its workspace boundary.

#### AI, Browser, and External Provider Boundary
Claude Code is the primary execution agent; the image also includes Gemini, Codex, Cursor, TaskMaster, and full-image-only providers. Credentials come from mounted state or environment variables and clients contact Anthropic, OpenAI, Google, Cursor, JetBrains, OpenRouter, Bedrock, Vertex, or Ollama directly—HolyClaude does not proxy provider credentials.

Chromium, Playwright, and optionally Xvfb provide browser automation. Compose supplies a large `/dev/shm` allocation and a permissive retained browser security profile; these are deployment-level constraints, not application logic.
- `docker-compose.yaml`
- `docker-compose.full.yaml`
- `scripts/holyclaude-chromium`

#### Deployment and Access Boundaries
Compose exposes CloudCLI only on `127.0.0.1:3001` by default. Optional SSH/Mosh requires explicit enablement, key mounts outside workspace/Claude state, persisted host keys, and port mappings. Reverse-proxy subpath deployment is mediated by `HOLYCLAUDE_BASE_PATH`; recommended remote access is via Tailscale or Cloudflare Tunnel rather than public port forwarding.
- `docker-compose.full.yaml`
- `docker-compose.podman-rootless.yaml`
- `s6-overlay/s6-rc.d/sshd/run`

#### CI and Artifact Publishing
GitHub Actions build and publish Docker images. The release pipeline validates product facts and integrity, while scripts provide reproducible patching, artifact verification, SBOM normalization, and policy checks.
- `.github/workflows/docker-publish.yml`
- `scripts/verify-product-facts.mjs`
- `scripts/verify-immutable-inputs.mjs`

Main entry points: [`s6-overlay/s6-rc.d/cloudcli/run`](https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/cloudcli/run) (CloudCLI), [`Dockerfile`](https://github.com/coderluii/holyclaude/blob/master/Dockerfile) (Image assembly), [`scripts/entrypoint.sh`](https://github.com/coderluii/holyclaude/blob/master/scripts/entrypoint.sh) (Privileged startup), [`docker-compose.full.yaml`](https://github.com/coderluii/holyclaude/blob/master/docker-compose.full.yaml) (Local and remote access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Image Build &amp; Release"]
  node_dockerfile["Image assembly<br/>multi-stage image build"]
  node_product_facts["Product facts contract<br/>release contract<br/>[product-facts.json]"]
  node_build_patches["Security backports &amp; patches<br/>build scripts"]
  node_input_policy["Immutable input policy<br/>supply-chain policy"]
  node_publish_ci["Publish pipeline<br/>GitHub Actions workflow<br/>[docker-publish.yml]"]
end

subgraph group_runtime["Container Runtime"]
  node_entrypoint["Privileged startup<br/>lifecycle script<br/>[entrypoint.sh]"]
  node_bootstrap["First-boot bootstrap<br/>state initialization<br/>[bootstrap.sh]"]
  node_s6{{"s6-overlay<br/>PID 1 supervisor<br/>[run]"}}
  node_cloudcli["CloudCLI<br/>browser control plane<br/>[run]"]
  node_ai_clis["AI CLI agents<br/>provider clients"]
  node_browser["Browser automation<br/>Chromium and Playwright"]
  node_xvfb["Xvfb service<br/>supervised display service<br/>[run]"]
  node_claude_state[("Mounted Claude state<br/>persistent host mount")]
  node_workspace[("Mounted workspace<br/>persistent host mount")]
  node_account_store[("CloudCLI account store<br/>SQLite state")]
end

subgraph group_access["Deployment &amp; Access"]
  node_compose["Compose entry points<br/>deployment manifests"]
  node_sshd["Optional SSH/Mosh<br/>supervised remote shell<br/>[run]"]
  node_local_access["Local and remote access<br/>network boundary"]
end

node_product_facts -->|"constrains"| node_dockerfile
node_input_policy -->|"governs"| node_build_patches
node_build_patches -->|"applied during build"| node_dockerfile
node_dockerfile -->|"packages"| node_cloudcli
node_dockerfile -->|"packages"| node_ai_clis
node_dockerfile -->|"packages"| node_browser
node_publish_ci -->|"validates"| node_product_facts
node_publish_ci -->|"builds and publishes"| node_dockerfile
node_compose -->|"starts container"| node_entrypoint
node_compose -->|"sets ports and deployment constraints"| node_local_access
node_entrypoint -->|"initializes on first boot"| node_bootstrap
node_entrypoint -->|"restores and prepares"| node_claude_state
node_entrypoint -->|"delegates to"| node_s6
node_s6 -->|"supervises"| node_cloudcli
node_s6 -->|"supervises"| node_xvfb
node_s6 -.->|"supervises when enabled"| node_sshd
node_xvfb -->|"provides display"| node_browser
node_cloudcli -->|"launches"| node_ai_clis
node_cloudcli -->|"uses"| node_workspace
node_cloudcli -->|"uses credentials and settings"| node_claude_state
node_cloudcli -->|"stores accounts"| node_account_store
node_local_access -->|"routes browser access"| node_cloudcli
node_local_access -.->|"optionally exposes"| node_sshd

click node_compose "https://github.com/coderluii/holyclaude/blob/master/docker-compose.yaml"
click node_dockerfile "https://github.com/coderluii/holyclaude/blob/master/Dockerfile"
click node_product_facts "https://github.com/coderluii/holyclaude/blob/master/contracts/product-facts.json"
click node_build_patches "https://github.com/coderluii/holyclaude/blob/master/scripts/patch-cloudcli-browser-runtime.mjs"
click node_input_policy "https://github.com/coderluii/holyclaude/blob/master/security/immutable-inputs.yml"
click node_publish_ci "https://github.com/coderluii/holyclaude/blob/master/.github/workflows/docker-publish.yml"
click node_entrypoint "https://github.com/coderluii/holyclaude/blob/master/scripts/entrypoint.sh"
click node_bootstrap "https://github.com/coderluii/holyclaude/blob/master/scripts/bootstrap.sh"
click node_s6 "https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/cloudcli/run"
click node_cloudcli "https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/cloudcli/run"
click node_browser "https://github.com/coderluii/holyclaude/blob/master/scripts/holyclaude-chromium"
click node_xvfb "https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/xvfb/run"
click node_claude_state "https://github.com/coderluii/holyclaude/blob/master/scripts/persist-claude-json.mjs"
click node_sshd "https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/sshd/run"
click node_local_access "https://github.com/coderluii/holyclaude/blob/master/docker-compose.full.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dockerfile,node_product_facts,node_build_patches,node_input_policy,node_publish_ci toneBlue
class node_entrypoint,node_bootstrap,node_s6,node_cloudcli,node_ai_clis,node_browser,node_xvfb,node_claude_state,node_workspace,node_account_store toneAmber
class node_compose,node_sshd,node_local_access toneMint
```

## Components

### Image Build & Release

- [Image assembly](https://github.com/coderluii/holyclaude/blob/master/Dockerfile): multi-stage image build · Builds full and slim workstation images. · `Dockerfile`
- [Product facts contract](https://github.com/coderluii/holyclaude/blob/master/contracts/product-facts.json): release contract · Declares release-sensitive versions and image expectations. · `contracts/product-facts.json`
- [Security backports & patches](https://github.com/coderluii/holyclaude/blob/master/scripts/patch-cloudcli-browser-runtime.mjs): build scripts · Patches upstream CloudCLI, browser runtime, and dependencies during image build. · `scripts/patch-cloudcli-browser-runtime.mjs`
- [Immutable input policy](https://github.com/coderluii/holyclaude/blob/master/security/immutable-inputs.yml): supply-chain policy · `security/immutable-inputs.yml`
- [Publish pipeline](https://github.com/coderluii/holyclaude/blob/master/.github/workflows/docker-publish.yml): GitHub Actions workflow · Validates contracts and publishes Docker images. · `.github/workflows/docker-publish.yml`

### Container Runtime

- [Privileged startup](https://github.com/coderluii/holyclaude/blob/master/scripts/entrypoint.sh): lifecycle script · Remaps IDs, restores state, prepares Git, then hands off to s6. · `scripts/entrypoint.sh`
- [First-boot bootstrap](https://github.com/coderluii/holyclaude/blob/master/scripts/bootstrap.sh): state initialization · Seeds default Claude state without overwriting persisted user changes. · `scripts/bootstrap.sh`
- [s6-overlay](https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/cloudcli/run): PID 1 supervisor · Separates boot repair from restartable services and handles signals. · `s6-overlay/s6-rc.d/cloudcli/run`
- [CloudCLI](https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/cloudcli/run): browser control plane · Runs as claude, serves port 3001, and manages CLI projects, plugins, and terminal access. · `s6-overlay/s6-rc.d/cloudcli/run`
- **AI CLI agents**: provider clients · Claude Code is primary; included clients contact providers directly.
- [Browser automation](https://github.com/coderluii/holyclaude/blob/master/scripts/holyclaude-chromium): Chromium and Playwright · Uses Xvfb when required for browser automation. · `scripts/holyclaude-chromium`
- [Xvfb service](https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/xvfb/run): supervised display service · `s6-overlay/s6-rc.d/xvfb/run`
- [Mounted Claude state](https://github.com/coderluii/holyclaude/blob/master/scripts/persist-claude-json.mjs): persistent host mount · Persists credentials, settings, memory, and Claude sessions at /home/claude/.claude. · `scripts/persist-claude-json.mjs`
- **Mounted workspace**: persistent host mount · Projects are persisted at /workspace and form CloudCLI's workspace boundary.
- **CloudCLI account store**: SQLite state · Container-local by default; a local named volume is supported but network filesystems are unsuitable.

### Deployment & Access

- [Compose entry points](https://github.com/coderluii/holyclaude/blob/master/docker-compose.yaml): deployment manifests · Quick, full, and rootless launch configurations. · `docker-compose.yaml`
- [Optional SSH/Mosh](https://github.com/coderluii/holyclaude/blob/master/s6-overlay/s6-rc.d/sshd/run): supervised remote shell · Requires explicit enablement, key mounts, persisted host keys, and port mappings. · `s6-overlay/s6-rc.d/sshd/run`
- [Local and remote access](https://github.com/coderluii/holyclaude/blob/master/docker-compose.full.yaml): network boundary · CloudCLI binds to localhost by default; remote access uses a base path or trusted tunnel. · `docker-compose.full.yaml`

## Connections

- Product facts contract → Image assembly: constrains
- Immutable input policy → Security backports & patches: governs
- Security backports & patches → Image assembly: applied during build
- Image assembly → CloudCLI: packages
- Image assembly → AI CLI agents: packages
- Image assembly → Browser automation: packages
- Publish pipeline → Product facts contract: validates
- Publish pipeline → Image assembly: builds and publishes
- Compose entry points → Privileged startup: starts container
- Compose entry points → Local and remote access: sets ports and deployment constraints
- Privileged startup → First-boot bootstrap: initializes on first boot
- Privileged startup → Mounted Claude state: restores and prepares
- Privileged startup → s6-overlay: delegates to
- s6-overlay → CloudCLI: supervises
- s6-overlay → Xvfb service: supervises
- s6-overlay → Optional SSH/Mosh: supervises when enabled
- Xvfb service → Browser automation: provides display
- CloudCLI → AI CLI agents: launches
- CloudCLI → Mounted workspace: uses
- CloudCLI → Mounted Claude state: uses credentials and settings
- CloudCLI → CloudCLI account store: stores accounts
- Local and remote access → CloudCLI: routes browser access
- Local and remote access → Optional SSH/Mosh: optionally exposes
