Skip to content

Can wb filter Claude Code's terminal output without breaking it?

Answered 2026-10-04. Decided 2026-10-04: A, allowlist as measured, and H1 plus a URL list for hyperlinks. Source: 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… (I30I30 (closed): X19-terminal-filter: Terminal stream filteringX19-terminal-filter (added to S11-verification-and-spikes in #14)). Feeds 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). (B37-terminal-boundaryB37-terminal-boundary: Should the host terminal be a trust boundary with its own filter?Yes, decided.) and I38I38 (closed): S06-vm-lifecycle: design port forwarding and clipboard (FR11-port-forward, FR12-clipboard) and their threatsFR11-port-forward (dev servers on host loopback) and FR12-clipboard (clipboard) cross the VM boundary, but no spec designs them and S03-requirements's threat model does not list them.. The check by eye in real terminals is I62I62 (closed): X19-terminal-filter: visual check in real terminalsSplit from #30 (X19-terminal-filter) during triage on 2026-10-04..

guest, untrustedClaude Codewrites any byteswb relayallowlist filterterminal emulatorGhostty, Terminal.apppassescursor, colors, title,keyboard and paste modesdropped, countedOSC 52 clipboard, file:// links,kitty graphics, iTerm2 filesnotifications: become a bell

Figure 1. The relay of a wb claude session with the filter from 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…. What draws the screen passes. What acts on the host is dropped whole and counted, and a desktop notification arrives as a bell without its text.

The spike leaves three choices open: what happens to /copy, to Claude Code’s desktop notifications, and to hyperlinks. The cards below cover the first two. Hyperlinks have their own cards after them, and combine with any of A, B or C.

Take the list 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… into 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).. OSC 52 is dropped, and notifications become a bell. Which links stay links depends on the hyperlink choice below.

As A, but OSC 9 and OSC 777 pass. The desktop shows Claude Code’s own notification text.

Hyperlinks.

Claude Code links file paths, web addresses and its own help pages with OSC 8. A link’s visible text can differ from where it goes, and a link to localhost or a private address names a service on the host, not in the guest.

No hyperlinks from the guest. The terminal still makes a bare web address clickable by itself.

Pass OSC 8 only for https:// to public dotted hostnames: no IP literals, no localhost, .local or .internal, no user name in the URL.

Section titled “H3. Pass a link only when its text is its URL”

The filter keeps a link only if the characters between its start and end equal its URL.

RequirementA. As measuredB. OSC 52 requestC. Notification text
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 userkeptholdsunchanged
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 never come from the agent’s terminaltitle and bell remain, see 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).same as Aguest text in notifications
FR12-clipboardFR12-clipboard: Opt-in clipboardText clipboard sharing is opt-in, per direction, with approval. clipboard opt-in, per direction, with approvalno crossingwith approvalno crossing
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 claude behaves as claudethree losses, all links with H1two losses, all links with H1two losses, all links with H1
WorkI37I37 (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). onlyI37I37 (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 the I38I38 (closed): S06-vm-lifecycle: design port forwarding and clipboard (FR11-port-forward, FR12-clipboard) and their threatsFR11-port-forward (dev servers on host loopback) and FR12-clipboard (clipboard) cross the VM boundary, but no spec designs them and S03-requirements's threat model does not list them. clipboard flowI37I37 (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). only
Details and glossary

How the filter works. It splits the stream into text, controls, and escape sequences. It passes a sequence only when a rule allows it and drops any other whole, from its ESC to its end. The terminal never sees the start of a dropped sequence. Each drop is counted by rule, so the session summary can say why something looked wrong (NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.).

Why file links go. Claude Code links the paths it shows with file:// URLs. In a guest those are guest paths. On the host they name another file or none, and a click opens whatever is there.

Glossary

  • Escape sequence: bytes starting with ESC that a terminal treats as a command, not text.
  • OSC 52: the sequence that sets the terminal’s clipboard.
  • OSC 8: a hyperlink around some text.
  • OSC 9, OSC 777: desktop notifications in iTerm2 and Ghostty.
  • Kitty graphics: a protocol for images in the terminal, one mode of which reads a file by its path.
  • Headless emulator: a terminal emulator in a library, with no window, used to compare screens.