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..
Design
Section titled “Design”Agent interface
Section titled “Agent interface”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:
- Command. The agent command name for
wb(claude, S05-01-agent-commandsS05-01-agent-commands: Agent CommandsHow wb claude passes its arguments to Claude Code, how it runs interactive and non-interactive sessions, and what a session does.), and the programwb-guestdstarts. - Install. How the image build gets and checks the agent’s build (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.).
- Configuration carry-in. Which of the user’s files reach the guest, and the filter they pass (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.).
- Launch. The environment variables
wb-guestdadds to the session’s allowlist, and the state the agent keeps per project (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”). - Guest instructions. The managed instructions file the image installs, and its text (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”).
- Credential bindings. The kinds of model credential, the guest variable that holds each placeholder, and the header each binding injects (S09-05-credentialsS09-05-credentials: CredentialsHow credentials are stored and bound to requests, and how the model credential reaches the model API without entering the guest., “Model credential”).
- Endpoint profile. The built-in HTTP profile the agent needs. For Claude Code that is the model API profile (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.).
Decisions
Section titled “Decisions”An interface shaped by Claude Code alone
Section titled “An interface shaped by Claude Code alone”The agent interface holds what Claude Code needs. It has no general design for agents that don’t exist yet.
- 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 6.
Out of scope
Section titled “Out of scope”- Carrying in a hook or an MCP server the user names. V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. carries none.
- Plugins, and
keybindings.json, output styles, and status line scripts in~/.claude/. - A project’s own
.mcp.jsonand.claude/in the repository. They reach the guest as part of the work, and Claude Code treats them as project configuration. - Agents other than Claude Code (V1-02-claude-onlyV1-02-claude-only: Claude Code onlyClaude Code is the supported agent.).
Status: Draft