← All work
Product · 2026

Idiomatic Go SDK for Cloud AI Agents

Overview

The official Go SDK for Chucky, an idiomatic, context-aware Go API for creating Claude sessions, sending messages, and handling streamed responses and tool calls against the cloud agent platform.

Why It Exists

Backend and infrastructure services are frequently written in Go. This SDK provides a native, dependency-light way to embed cloud AI agents into Go programs, mirroring the TypeScript reference SDK’s feature set.

What We Built

A cleanly packaged module under pkg/: pkg/chucky (client.go, session.go) for clients and multi-turn sessions, pkg/tools (mcp_server.go, tool.go) for custom tools and MCP servers, pkg/transport for the WebSocket connection, pkg/types (messages, options, results, tokens, tools, errors), and pkg/utils/token.go for CreateToken/CreateBudget HMAC budget tokens. All calls are context.Context-aware for cancellation and timeouts. The repo ships runnable examples under cmd/examples (basic, simple_prompt, multi_turn), a tool-test harness, an integration_test.go, and a Makefile.

Technologies & Approach

Pure Go using the standard library idioms, explicit Options structs, context propagation, and a deferred client.Close(). Budget tokens (AI-dollars, compute-hours, time window) are minted client-side and carried over the WebSocket transport, identical in shape to the other language SDKs.

Outcome / Impact

Brings the platform’s session, streaming, tools, and MCP capabilities to Go services with an idiomatic API and runnable examples covering the common usage patterns.

Capabilities Demonstrated

  • Idiomatic, context-aware Go SDK design
  • Streaming sessions and tool calls over WebSocket
  • Well-structured Go package layout (client/transport/types/utils)
  • Cross-language protocol parity
More work See all →