Harness SDK

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 useHarnessRuntime hook
  • Tap-based reactivity — stable identity, automatic lifecycle management

Packages

PackageDescription
harness-sdkCore client — types, transport, Harness class
@harness-sdk/reactReact bindings — useHarness hook
@assistant-ui/react-harness-sdkassistant-ui bridge — useHarnessRuntime
@harness-sdk/serverCloudflare Worker + Durable Object server

How it works

Browser ←─ WebSocket ─→ HarnessGateway ─→ HarnessSession ←─ RunnerProtocol ─→ SandboxRunner
                          (CF Worker)       (Durable Object)                    (Container)
  1. The client opens a WebSocket to the HarnessGateway
  2. The gateway routes to a HarnessSession Durable Object (per user)
  3. The DO manages state and communicates with the SandboxRunner in a container
  4. State updates stream back as deltas over the WebSocket