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.
- Serve a useChat frontend from Go: the request and response protocol, validation, keep-alive, CORS, proxies and custom data parts.
- Tool approval end to end: let a model ask and a user decide, with signed approval requests.
- 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.
| Piece | Where it lives |
|---|---|
| Chat endpoint, validation, keep-alive | server/chat.go |
| Tools and the approval-gated tool | server/tools.go |
| Claude Code and Codex through the harness | server/coder.go |
useChat setup and approval buttons | web/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.