The Claude Agent SDK is Anthropic’s official SDK for building production-ready AI agents with Claude. Braintrust automatically traces agent queries, tool executions, and multi-step reasoning.Documentation Index
Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
This guide covers manual instrumentation. For quicker setup, use auto-instrumentation.
Setup
Install the Braintrust SDK alongside the Claude Agent SDK:Trace with Claude Agent SDK
Braintrust provides wrapper functions that automatically instrument the Claude Agent SDK to capture agent interactions, tool calls, and query results. This example creates a calculator tool and traces multi-step agent queries:claude-agent.ts
Trace nested agent operations
When building complex agent systems with multiple operations, you can usewrapTraced to organize agent calls into parent-child traces. Braintrust automatically captures the hierarchical relationships, making it easy to understand multi-step workflows in your logs.
nested-agents.ts