S05 - Command Line Interface
Purpose: Specify wb, the single user-facing command.
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]. to FR05-parallel-sessionsFR05-parallel-sessions: Parallel sessionsSeveral sessions can run at once, in the same project and across projects., FR09-approve-unknownFR09-approve-unknown: Approve unknown destinationsA request to an unknown destination is blocked and offered to the user for approval out-of-band (allow once, allow for project, deny)., FR12-clipboardFR12-clipboard: Opt-in clipboardText clipboard sharing is opt-in, per direction, with approval., 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. to FR17-same-everywhereFR17-same-everywhere: Same on every hostThe same wb commands, flags, policy files, and behavior on every host OS., 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., SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter., SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream., NFR01-startupNFR01-startup: StartupGoals: a warm VM reaches the Claude prompt in about 4 s and a suspended VM in about 7 s, and no start takes more than 10 s (p95), excluding first-time project setup and the first boot after a host restart., NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it..
Briefs: B37-terminal-boundaryB37-terminal-boundary: Should the host terminal be a trust boundary with its own filter?Yes, decided., B42-trust-placementB42-trust-placement: Where does a new project run, and what makes it the same project later?Split "trusted" into two named settings, start new projects in the isolated VM until the user moves them, and key project identity on the git directory rather than the remote URL., B46-session-lifecycleB46-session-lifecycle: What happens to a running session when its terminal closes or its VM stops?Recommended that closing the terminal detaches an interactive session, which `wb attach` resumes, that a session ends only when claude exits, and that `wb` exits 255 when it loses a session.
Design
Section titled “Design”wb [wb flags] <command> [command args]wb is a dispatcher in the style of gh or git. Every capability is
a subcommand of the one binary. There is no second CLI.
- wb flags come before the command. They are the only arguments
wbitself parses. An unknown flag there is an error, and is never passed on. - The command is the first non-flag argument.
- Command arguments belong to the command. For agent commands,
wbdoesn’t parse them at all (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.). wbwith no command,wb helpandwb --helpprint the command list.wb versionandwb --versionprint the version.- A usage error exits with status 2 and prints the help.
Global flags
Section titled “Global flags”| Flag | Meaning |
|---|---|
-C <dir> |
Act as if wb was started in <dir> |
--help, -h |
Help |
--version |
Version |
| Page | What it covers |
|---|---|
| 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. | wb claude: arguments, interactive use, session flags and session behavior |
| S05-02-exit-status-and-signalsS05-02-exit-status-and-signals: Exit Status and SignalsWhat wb claude exits with, and what it does with each signal. | What wb claude exits with, and which signals it forwards |
| S05-03-management-commandsS05-03-management-commands: Management CommandsThe commands of wb other than the agent commands. | Every other command of wb |
| S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed. | Project keys, ids, recorded identity, registration, moving and removing projects |
Terminal stream
Section titled “Terminal stream”The guest output that wb claude and wb shell write passes an
allowlist filter in wb. That is boundary 6 of T00-indexT00-indexboundary 6 is the host terminal stream.
(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.). S16-terminal-streamS16-terminal-stream: Terminal StreamHow wb guards boundary 6 of T00-index, the guest output that wb writes to the user's terminal. specifies the filter, and
everything else wb does at that boundary.
The filter and wb treat the stream this way:
- OSC 52 is dropped, because V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. has no clipboard (V1-08-no-forward-clipboardV1-08-no-forward-clipboard: No port forwarding or clipboardPort forwarding (FR11-port-forward) and the clipboard (FR12-clipboard) are out of scope for V1, so nothing new crosses the VM boundary for them (S06-vm-lifecycle).).
- Notifications become a bell.
- Links are dropped on screen and listed in the session summary.
wbsets the window title itself.wbresets the terminal before the summary.wbpasses seven environment variables to the guest.
wb diff, logs and audit records show control sequences in guest text
escaped, where a reviewer sees them. Other output outside the stream
removes them.
Controls
Section titled “Controls”- 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.: nothing the agent produces runs on the host without the user. It is kept, and extended to the terminal.
- SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream.: the guest can’t spoof approvals. It is kept, and extended to the terminal.
- FR12-clipboardFR12-clipboard: Opt-in clipboardText clipboard sharing is opt-in, per direction, with approval.: clipboard is opt-in, with approval. It is kept, because OSC 52 never passes.
- FR01-drop-inFR01-drop-in: Drop-in for claudewb is the single entry point for everything, structured as wb [wb flags] <command> [command args].:
wb claudebehaves asclaude. It holds, except that/copy, notification text, links and Claude Code’s own window title are lost.
On WSL
Section titled “On WSL”Inside a WSL 2 distribution on a Windows host, wb runs in client mode
(FR16-wslFR16-wsl: WSL on WindowsOn a Windows host, wb run inside a WSL 2 distribution works on repositories in that distribution, using the VMs and services of the Windows host., S12-platformsS12-platforms: PlatformsWhich host and guest operating systems Wraith Box targets, how platform-specific code is isolated, what each platform uses, and how wb works inside WSL.). It has the same commands and flags, served
by the Windows host’s wb-hostd.
- The repository, the terminal and
wb landare on the WSL side. - VMs, policy, credentials and audit are on the Windows side.
Decisions
Section titled “Decisions”An allowlist filter on guest output
Section titled “An allowlist filter on guest output”Guest output that reaches the user’s terminal passes an allowlist
filter in wb (S16-terminal-streamS16-terminal-stream: Terminal StreamHow wb guards boundary 6 of T00-index, the guest output that wb writes to the user's terminal.). The allowlist is the one measured
in X19-terminal-filterX19-terminal-filter: Terminal stream filteringWhich terminal escape sequences does Claude Code emit, and can wb drop the ones that act on the host (clipboard writes, file transfer, terminal multiplexer control sequences) without visible damage in the common macOS…, tightened as the security review of PR66PR66 (merged): docs(spikes): X19-terminal-filter result, yes with conditionsAnswer: yes, with conditions, for Ghostty and Terminal.app, as far as a headless emulator can show. asked.
- Assumed: a headless emulator shows what Ghostty and Terminal.app
show. I62I62 (closed): X19-terminal-filter: visual check in real terminalsSplit from #30 (X19-terminal-filter) during triage on 2026-10-04. checks that by eye. Both terminals answer the drain’s
CSI ? 6 n. The caps fit later Claude Code versions. Drop counts show it when they don’t. - Decided: I37I37 (closed): S03-requirements, S05-cli: treat the host terminal stream as a boundarywb claude relays the guest's PTY output in raw mode to the user's terminal emulator (S05-cli). and I30I30 (closed): X19-terminal-filter: Terminal stream filteringX19-terminal-filter (added to S11-verification-and-spikes in #14) (B37-terminal-boundaryB37-terminal-boundary: Should the host terminal be a trust boundary with its own filter?Yes, decided.).
Escape guest text outside the stream, don’t strip it
Section titled “Escape guest text outside the stream, don’t strip it”wb diff, logs and audit records show control sequences escaped. Other
output still removes them.
- Why: a reviewer sees them there. X19-terminal-filterX19-terminal-filter: Terminal stream filteringWhich terminal escape sequences does Claude Code emit, and can wb drop the ones that act on the host (clipboard writes, file transfer, terminal multiplexer control sequences) without visible damage in the common macOS… asks for escaping in logs.
- Rejected: stripping control sequences from all guest text outside the stream, as the I37I37 (closed): S03-requirements, S05-cli: treat the host terminal stream as a boundarywb claude relays the guest's PTY output in raw mode to the user's terminal emulator (S05-cli). decision says. This is the one change from it.
Reset the terminal on exit
Section titled “Reset the terminal on exit”wb resets the terminal on exit (S16-03-around-the-streamS16-03-around-the-stream: Around the StreamWhat wb writes to the terminal around the filtered stream, the terminal environment the guest gets, and how guest text in wb's other output is escaped., “Reset on exit”).
- Rejected: running the session on an alternate screen of
wb’s own. - Decided: I37I37 (closed): S03-requirements, S05-cli: treat the host terminal stream as a boundarywb claude relays the guest's PTY output in raw mode to the user's terminal emulator (S05-cli)., 2026-10-06.
The full filter on every stream
Section titled “The full filter on every stream”A stream that goes to a pipe or a file passes the same full filter as terminal output (S16-01-filterS16-01-filter: FilterWhere wb filters guest output, how the filter splits it into tokens, and the allowlist of what passes., “Where”).
- Decided: I37I37 (closed): S03-requirements, S05-cli: treat the host terminal stream as a boundarywb claude relays the guest's PTY output in raw mode to the user's terminal emulator (S05-cli)., 2026-10-06.
Status: Draft