Skip to content

S05-01 - Agent Commands

Purpose: How wb claude passes its arguments to Claude Code, how it runs interactive and non-interactive sessions, and what a session does.

wb [wb flags] claude [claude args]

Every argument after claude reaches Claude Code unchanged. That includes arguments that look like wb flags:

  • wb claude --help shows Claude Code’s help.
  • wb claude --isolated passes --isolated to Claude Code.

So wb claude --resume, wb claude -p "…" and wb claude mcp list behave as claude … does. No current or future Claude Code flag or subcommand can collide with Wraith Box (FR01-drop-inFR01-drop-in: Drop-in for claudewb is the single entry point for everything, structured as wb [wb flags] <command> [command args].).

Users who want the bare word can alias it in their shell (alias claude='wb claude'). Wraith Box doesn’t install such an alias.

Use is interactive when wb’s standard input and standard output are both terminals.

  • wb relays the TTY in raw mode, and claude runs on a PTY in the guest.
  • Window-size changes are forwarded.
  • Standard error goes to the PTY too. When wb’s standard error isn’t a terminal, it is on its own channel instead.

Use is non-interactive when either isn’t a terminal, such as a pipe, or claude -p … > out.txt.

  • Standard input and standard output are streamed.
  • Standard error is on its own channel.

wb doesn’t read claude’s arguments to decide. So wb claude -p "…" in a terminal is interactive use, as claude -p "…" there has a terminal. The exit status is in 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..

Further agents are further agent commands (wb <agent> …), behind the same agent interface (V1-02-claude-onlyV1-02-claude-only: Claude Code onlyClaude Code is the supported agent., S14-claude-in-guestS14-claude-in-guest: Claude Code in the GuestHow 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-only)., “Agent interface”). claude is the only one in v1.

S14-claude-in-guestS14-claude-in-guest: Claude Code in the GuestHow 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-only). says:

  • how Claude Code gets into the guest;
  • which of the user’s ~/.claude/ goes with it;
  • which Claude Code commands don’t work in a guest.

These flags are valid only before an agent command. Before any other command, they are a usage error.

Flag Meaning
--isolated Run this session in the isolated VM, whatever the project’s placement (SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another., S06-04-vms-and-placementS06-04-vms-and-placement: VMs and PlacementThe work VM and the isolated VM, Xcode in them, and which VM a project's sessions run in.)
--ephemeral No persisted state for this session (FR14-ephemeralFR14-ephemeral: Ephemeral sessionsAn ephemeral mode runs a session with no persisted state.)
--learn Learn mode (FR10-learn-modeFR10-learn-mode: Learn modeA learn mode, available only to projects whose placement is work (S05-cli), records the destinations a project needs and proposes an allowlist.), with the refusals below
--guest <os> Guest OS for this project, where the host offers more than one (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.). Otherwise the project’s configured or default guest

--learn is refused:

While a learn-mode session runs, wb-hostd also refuses other projects’ sessions.

wb claude must run inside a git repository. Otherwise wb exits with 255, with a message that says why: the return path is git (S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem.).

wb refuses the session, before it opens one, when the host terminal’s charset isn’t UTF-8 (S16-01-filterS16-01-filter: FilterWhere wb filters guest output, how the filter splits it into tokens, and the allowlist of what passes., “Where”). It exits with 255 and logs the rule terminal-charset-not-utf8. The refusal names the variable it read and its value, and says to set that variable to a UTF-8 locale. No flag overrides it. This holds when the output goes to a pipe or a file as well, and for wb shell.

Closing the terminal ends the session.

  1. claude gets a hangup.
  2. Its work is committed as WIP, and pushed as on a normal exit.

V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. has no detach and no wb attach. wb claude --continue starts a new session at the host’s HEAD, which resumes the project’s most recent conversation. The files the old session left uncommitted are only in its WIP commit, and wb land brings them back. The states of a session are in S06-09-session-lifecycleS06-09-session-lifecycle: Session LifecycleA session's states from wb claude to its summary, how it starts and ends, its deadlines, and when its VM may be saved..

The first run in a repository registers the project. It creates the project’s guest user and clone, then starts the session. Later runs reuse them.

At registration, wb creates the project directory <data>/projects/<project-id>, and the export.git in it. wb-hostd can’t write either (S08-02-export-repositoryS08-02-export-repository: Export RepositoryWhich refs and objects the guest can fetch from export.git, and how wb, its one writer, keeps it safe to run git in.).

On macOS, wb prints one line on its standard error before the session starts:

  • when the expiry date of the signing profile in the helper bundles is 30 days away or less;
  • or after that date.

The line gives the date (S12-03-host-prerequisitesS12-03-host-prerequisites: Host PrerequisitesWhat wb setup checks on each host, and how a development build on macOS gets signed., “Development builds on macOS”).

On exit, wb prints a short summary of the session’s returned work, and the commands to review and land it. The summary goes to its standard error, in interactive and non-interactive use. So it never mixes into claude’s output on standard output. For example:

wraith box: session myrepo-20261003-1412-k3f9 returned 3 commits (+ WIP)
review: wb diff myrepo-20261003-1412-k3f9
land: wb land myrepo-20261003-1412-k3f9
⚠ flagged: package.json scripts changed, .github/workflows/ci.yml changed
terminal: dropped 1 clipboard write, 2 notifications became a bell
links: Security guide https://docs.example.com/security
src/main.go file:///…/myrepo/src/main.go (guest path)

During an agent session, wb never prints approval prompts. That terminal shows the agent’s output, which the guest controls. So any prompt there could be forged (SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream.). Approvals arrive as native notifications, or are answered with wb approve from another terminal.

Status: Draft