S14-01 - Install
Purpose: How the image build downloads Claude Code on the host, checks it, and installs it in the guest image, and which version a guest runs.
Design
Section titled “Design”Only the host downloads Claude Code. The guest never fetches it.
downloads.claude.ai is outside every profile the guest gets
(S07-11-http-policyS07-11-http-policy: HTTP PolicyThe HTTP rules of inspected hosts, the built-in profiles, and the parts a user can turn off., “model API”, “Outside the profile”).
Download
Section titled “Download”During wb image build, wb-download (S17-03-downloadsS17-03-downloads: DownloadsHow wb-download fetches what an image build needs from the internet.) fetches three files from
https://downloads.claude.ai/claude-code-releases/<version>/:
- the release’s
manifest.json; - its detached signature,
manifest.json.sig; - the guest’s binary.
For a macOS guest, the binary is at <version>/darwin-arm64/claude.
That path is compiled into Wraith Box for each guest platform, so
wb-download doesn’t read the manifest.
The binary is one uncompressed Mach-O executable. Anthropic PBC signs it, and Apple notarizes it.
wb-hostd itself doesn’t open an outbound connection.
wb-release-check (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.) checks the files. wb-hostd
starts this per-run program through wb-launcher.
- It reads the files on inherited descriptors.
- It writes a fixed-format record to its result channel, a socket
(S04-05-helper-programsS04-05-helper-programs: Helper ProgramsThe programs that run once for an image build or a store operation: wb-guestadmin, wb-release-check, wb-download and wb-build-ssh.). The record is
passwith the manifest’s signed SHA-256 checksum for the guest’s platform, or the rule of the failed check.
wb-hostd doesn’t parse the signature or the manifest. They are bytes
from the network, and the process that faces the guest doesn’t run a
third-party parser over them (SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts.).
The check follows Anthropic’s “Binary integrity and code signing” (https://code.claude.com/docs/en/setup). It checks that:
- The detached signature verifies over
manifest.jsonwith Anthropic’s Claude Code release key.- The full public key is compiled into Wraith Box. Wraith Box never downloads the key.
- Its fingerprint is
31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE.
- The manifest’s
versionequals the version the build asked for. An older signed release served under a newer path then fails. Both are in the one form of S17-04-restore-and-releaseS17-04-restore-and-release: Restore Image and ReleaseThe steps by which wb-download and wb-hostd fetch and check a macOS restore image and a Claude Code release., “The version”. - The version is at least the minimum compiled into Wraith Box,
2.1.289.
- That is the Claude Code version that X01-model-credentialX01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh? measured the model API profile with.
- Releases before 2.1.89 have no signature, and this minimum refuses them too.
- The manifest has an entry for the guest’s platform,
darwin-arm64for a macOS guest. - That entry’s
binaryfield is the file name the download used,claude. - The binary’s size and SHA-256 equal that entry’s
sizeandchecksum.
Any failed check fails the build. The build logs the check that failed. The manifest parser has a fuzz target.
The checked bytes
Section titled “The checked bytes”wb-hostd opens the binary once and keeps that descriptor. Then:
- It
fstats the descriptor. It refuses a file that isn’t a regular file, with the ruleclaude-release-bytes-changed. - It passes a duplicate of the descriptor to
wb-release-check. - After a
pass, it reads the file withpreadfrom offset 0. It usespreadbecause the duplicate shares the child’s file offset. - It streams the file to
wb-guestd, and hashes it as it sends. - Only after the last byte, it sends the SHA-256 from the record.
wb-guestd writes the stream to a temporary file that only root can
write. It installs the file only when both hold:
- the SHA-256 of what it received equals the one
wb-hostdsent; wb-hostdreports that its own hash of the sent bytes matched too.
A file changed between the check and the send fails the build, with
the rule claude-release-bytes-changed.
Into the image
Section titled “Into the image”wb-guestd installs the binary through a named operation of the
Claude Code layer build, before that layer is sealed
(S06-01-image-layersS06-01-image-layers: Image Layers and the Toolchain PrefixThe layers of a guest image, and the toolchain prefix that project layers install into., “The Claude Code layer”).
- It installs it as
/usr/local/bin/claude, owned by root, with mode 755. - The directory is one that project users can’t write to.
- The toolchain user can’t write it either, so a project’s formulae can’t replace it (S06-01-image-layersS06-01-image-layers: Image Layers and the Toolchain PrefixThe layers of a guest image, and the toolchain prefix that project layers install into., “Toolchain prefix”).
wb-guestd starts Claude Code by that absolute path, never through
PATH.
The same operation installs the guest instructions, a managed
CLAUDE.md (S14-04-commands-and-endpointsS14-04-commands-and-endpoints: Commands and EndpointsWhich permission mode Claude Code runs in, the commands that don't work in a guest, the guest instructions that explain the guest's limits to Claude Code, and the endpoints Claude Code in the guest may reach., “Guest instructions”).
Version
Section titled “Version”The image sets the Claude Code version. The installed binary can’t change:
- project users can’t write it;
DISABLE_UPDATES=1blocks every update path (S06-08-projects-and-sessionsS06-08-projects-and-sessions: Projects and Sessions Inside a VMHow projects map onto guest users and sessions onto worktrees, and how Claude Code runs in the guest., “Claude Code in the guest”).
The profile is the control. An agent can still install another Claude
Code in its own home, for example with npm. wb-guestd doesn’t
start that one. An updater would fetch and run a binary past
SEC07-dep-gateSEC07-dep-gate: Dependency gatePackage downloads (npm, PyPI, Go modules, crates) are refused when the version is younger than a minimum age or has a known vulnerability at or above a severity threshold..
A new version arrives with a new image, in which only the Claude Code
layer is rebuilt (S06-01-image-layersS06-01-image-layers: Image Layers and the Toolchain PrefixThe layers of a guest image, and the toolchain prefix that project layers install into., “The Claude Code layer”). wb image list shows each image’s Claude Code version.
Which release
Section titled “Which release”A build installs the release of Anthropic’s stable channel, unless the
user names a version with wb image build --claude-version <version>.
The stable channel is the file
https://downloads.claude.ai/claude-code-releases/stable. Its body is
the version as plain text, such as 2.1.308. Anthropic’s own installer
reads the same file for its stable target, next to latest. The
channel file isn’t signed. So:
- the version it names goes through “Check” above, with the signature, the equal version and the minimum;
wb-hostdrefuses a version older than the one in the last Claude Code layer a build sealed, of any image, withclaude-release-rollback. A version the user names with--claude-versionisn’t refused for that, but the minimum still applies.
A forged channel file can then only pick another signed release, not
older than the one the last layer has. After an image built with a
newer --claude-version, a build from the stable channel is refused
until the channel catches up, or the user names a version again. A new
model can need a release newer than the stable channel’s, and
--claude-version is the way to get one. S17-04-restore-and-releaseS17-04-restore-and-release: Restore Image and ReleaseThe steps by which wb-download and wb-hostd fetch and check a macOS restore image and a Claude Code release.,
“The version”, has the steps.
Version skew
Section titled “Version skew”The host’s Claude Code and the guest’s can differ, and nothing compares them. Only configuration files cross (S14-02-user-configurationS14-02-user-configuration: User ConfigurationWhich of the user's Claude Code configuration wb reads at session start, and how it treats symbolic links in it.). How the guest’s build treats a key it doesn’t know is up to that build.
Decisions
Section titled “Decisions”Only the host downloads Claude Code
Section titled “Only the host downloads Claude Code”- Decided: I45I45 (closed): S14 (new): Claude Code in the guest and the agent interface (V1-02-claude-only)No spec says how Claude Code itself runs in the guest., row 1.
Claude Code in its own layer, from the stable channel
Section titled “Claude Code in its own layer, from the stable channel”- Why: Claude Code releases often, and the updater is off in the guest. With a layer of its own, a new release rebuilds only that layer.
- Rejected:
latestas the default. Anthropic’s setup page says the stable channel is typically about a week behind, and skips releases with major regressions. - Decided: I220I220 (closed): Cheap image rebuild for a new Claude Code version- Which stage a Claude Code-only rebuild starts from (a sealed earlier stage, a clone of the image before sealing, or another layer), and how that fits sealing and "never updated in place"..
Status: Draft