Skip to main content

Build a chat app

Three guides cover the path from a streaming endpoint to a chat product that can change code on a user's behalf. They follow the code in the Shipyard demo, a reference app you can run and read.

  1. Serve a useChat frontend from Go: the request and response protocol, validation, keep-alive, CORS, proxies and custom data parts.
  2. Tool approval end to end: let a model ask and a user decide, with signed approval requests.
  3. Coding agents with the harness: run Claude Code or Codex in a sandbox and show their work in the chat.

The reference app​

Shipyard is a Next.js page that uses the stock useChat hook, talking to a Go server built with the Go AI SDK. A failing Go project sits in a workspace. The chat model investigates with its own tools, asks the user before handing the fix to Claude Code or Codex, and streams the coding agent's activity into the thread.

PieceWhere it lives
Chat endpoint, validation, keep-aliveserver/chat.go
Tools and the approval-gated toolserver/tools.go
Claude Code and Codex through the harnessserver/coder.go
useChat setup and approval buttonsweb/app/page.tsx

Short versions​

If you only need the code, the recipes have one page per task, each with a program you can run.