Skip to content

S14 - Claude Code in the Guest

Purpose: How Claude Code gets into the guest image, which of the user’s Claude Code configuration goes with it, how it starts, and the agent interface that keeps Claude Code’s specifics in one place (V1-02-claude-onlyV1-02-claude-only: Claude Code onlyClaude Code is the supported agent.).

Requirements: FR01-drop-inFR01-drop-in: Drop-in for claudewb is the single entry point for everything, structured as wb [wb flags] <command> [command args]., FR13-claude-stateFR13-claude-state: Claude Code state per projectClaude Code's conversation history, and the state it keeps only in the guest, persist per project, so --resume/--continue work within a project., SEC02-no-host-fs-shareSEC02-no-host-fs-share: No host filesystem sharingNo host directory is mounted into the guest, read-only or otherwise., SEC03-no-host-execSEC03-no-host-exec: No host code execution via returned workNothing the agent produces executes on the host without an explicit user action; returned changes to files the host may later execute are flagged., SEC04-no-guest-secretsSEC04-no-guest-secrets: No secrets in the guestThis includes the model credential., SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable., 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., SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter., SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts..

Tests: C06-model-apiC06-model-api: Model APIThe test cases for the model credential: its placeholder, the scan for the placeholder in whole requests, what is injected on the model API, the event log, and Claude Code end to end.

Brief: B45-claude-in-guestB45-claude-in-guest: How does Claude Code run in the guest, and which of the user's settings go with it?Carry in an allowlist of the user's Claude Code configuration with secrets and hooks removed, start in bypassPermissions mode, and pin Claude Code in the image with every in-guest update path off.

host: trusted ~/.claude/ CLAUDE.md, agents, skills, commands, settings.json ~/.claude.json sign-in, MCP servers wb-download fetches a Claude Code build Anthropic model API, downloads wb allowlist, filter, secret scan wb-hostd has the build checked by wb-release-check wb-proxyd model API profile, injects the credential guest VM: untrusted wb-guestd installs as root, copies as the user project user ~/.claude/ copy Claude Code root-owned, set by the image, updates off via wb-netd never
Claude Code in the guest. wb reads an allowlist of the user's ~/.claude/, filters and scans it, and wb-hostd hands the copy to wb-guestd, which writes it as the project user. ~/.claude.json never reaches the guest. wb-download fetches a Claude Code build on the host, wb-release-check checks it for wb-hostd, and wb-guestd installs it root-owned during the image build. Claude Code reaches Anthropic only through wb-proxyd, which injects the model credential.
Page What it covers
S14-01-installS14-01-install: InstallHow the image build downloads Claude Code on the host, checks it, and installs it in the guest image, and which version a guest runs. How the image build downloads, checks and installs Claude Code, and its version
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. Which of the user’s ~/.claude/ entries wb reads, and how it treats symbolic links
S14-03-configuration-filterS14-03-configuration-filter: Configuration FilterThe units, bounds, filters and secret scan that the user's configuration passes, and how wb-guestd writes the copy in the guest. The filter, scan and caps the copy passes, and how wb-guestd writes it
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. The permission mode, the commands that don’t work in a guest, the guest instructions, and the endpoints Claude Code may reach

Claude Code is the only agent in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there.. The interface is what Claude Code needs, with no general design before a second agent exists.

Agent-specific code is in one Go package per agent, internal/agent/claude. wb, wb-hostd and wb-guestd call it only through the interface in internal/agent. An agent supplies:

The agent interface holds what Claude Code needs. It has no general design for agents that don’t exist yet.

Status: Draft