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.
Design
Section titled “Design”wb claude
Section titled “wb claude”wb [wb flags] claude [claude args]Every argument after claude reaches Claude Code unchanged. That
includes arguments that look like wb flags:
wb claude --helpshows Claude Code’s help.wb claude --isolatedpasses--isolatedto 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.
Interactive and non-interactive use
Section titled “Interactive and non-interactive use”Use is interactive when wb’s standard input and standard output are
both terminals.
wbrelays the TTY in raw mode, andclauderuns 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
Section titled “Further agents”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.
- 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.
Session flags
Section titled “Session flags”These flags are valid only before an agent command. Before any other command, they are a usage error.
--learn is refused:
- unless the project’s
placementiswork.config_trustdoesn’t count; - with
--isolated; - by
wb-hostd, while a session of another project runs in the VM, a debug shell included (S07-17-approvals-and-learningS07-17-approvals-and-learning: Approvals and LearningHow an unknown destination reaches the user as an approval request, what an approval grants, and how learn mode collects names.).
While a learn-mode session runs, wb-hostd also refuses other
projects’ sessions.
Session behavior
Section titled “Session behavior”Inside a git repository
Section titled “Inside a git repository”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.).
A terminal that isn’t UTF-8
Section titled “A terminal that isn’t UTF-8”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
Section titled “Closing the terminal”Closing the terminal ends the session.
claudegets a hangup.- 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..
First run
Section titled “First run”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.).
Signing profile expiry
Section titled “Signing profile expiry”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”).
Summary on exit
Section titled “Summary on exit”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)- A session can end after its terminal closed, or after it was lost.
Then no
wbis left to print the summary, andwb sessionsshows it. - Each of several parallel sessions prints its own (FR05-parallel-sessionsFR05-parallel-sessions: Parallel sessionsSeveral sessions can run at once, in the same project and across projects.).
- A session’s changes can stay in the guest, after a deadline or a
failed WIP commit or push. The summary and
wb sessionsthen give the worktree’s path in the guest, andwb shell --project Pto reach it (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., “Changes left in the guest”). - When the VM’s
wb-netdorwb-proxydwas down during the session, the summary says so, and for how long (S04-07-supervisionS04-07-supervision: SupervisionWho starts and restarts each host process, what happens when wb-hostd stops or the bundle is upgraded, and daemon outages.).
No approval prompts
Section titled “No approval prompts”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.
Decisions
Section titled “Decisions”Closing the terminal ends the session
Section titled “Closing the terminal ends the session”- Decided: I46I46 (closed): S05-cli, S06-vm-lifecycle: session lifecycle, detach, sleep and failureS05-cli and S06-vm-lifecycle describe starting a session and its summary at the end, but not what happens in between, or when things go wrong: (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.).
Status: Draft