Skip to main content
The Claude Agent SDK is an SDK for building agents with Claude. LangSmith provides native integration with the Claude Agent SDK to automatically trace your agent executions, tool calls, and interactions with Claude models.
In an agent-based workspace, create an agent once before sending traces. Use agent addressing to select its identifier and environment. If an integration requires project_name, use the selected environment’s tracer_session_name as a compatibility value.

Installation

Install the LangSmith integration for Claude Agent SDK

Setup

Sending traces to an agent requires langsmith>=0.14.9 in Python or langsmith@>=0.11.0 in TypeScript. Set your API keys, agent identifier, and environment:
Get your LangSmith API key from Settings in the LangSmith UI. Use the agent identifier and environment selected during setup. For an Anthropic API key, refer to the Claude console.

Quickstart

To enable LangSmith tracing for your Claude Agent SDK code, call configure_claude_agent_sdk() before running your agent:
Once configured, all Claude Agent SDK operations will be automatically traced to LangSmith, including:
  • Agent queries and responses
  • Tool invocations and results
  • Claude model interactions
  • MCP server operations