Introduction
Connect assistant-ui to Claude Code via sandboxed containers
Harness SDK connects your frontend to Claude Code running in sandboxed Cloudflare containers. It provides:
- Real-time streaming via WebSocket with incremental state deltas
- Sandbox isolation — each user gets their own container
- assistant-ui integration — drop-in
useHarnessRuntimehook - Tap-based reactivity — stable identity, automatic lifecycle management
Packages
| Package | Description |
|---|---|
harness-sdk | Core client — types, transport, Harness class |
@harness-sdk/react | React bindings — useHarness hook |
@assistant-ui/react-harness-sdk | assistant-ui bridge — useHarnessRuntime |
@harness-sdk/server | Cloudflare Worker + Durable Object server |
How it works
Browser ←─ WebSocket ─→ HarnessGateway ─→ HarnessSession ←─ RunnerProtocol ─→ SandboxRunner
(CF Worker) (Durable Object) (Container)- The client opens a WebSocket to the HarnessGateway
- The gateway routes to a HarnessSession Durable Object (per user)
- The DO manages state and communicates with the SandboxRunner in a container
- State updates stream back as deltas over the WebSocket