Skip to main content
Looking for TypeScript? See the TypeScript guide.
PyPI Version This module provides OpenInference instrumentation for Anthropic’s Claude Agent SDK, automatically capturing AGENT and TOOL spans that follow OpenInference semantic conventions.

Install

Setup

Use the register function to connect your application to Phoenix:

Run Claude Agent SDK

A simple Claude Agent SDK application that is now instrumented:

Observe

With instrumentation enabled, you will see the following in Phoenix:
  • AGENT spans wrapping the full query() call, capturing the prompt and final response
  • TOOL spans for each tool invocation made by the agent during execution (e.g., Bash commands, file reads)
These spans follow OpenInference semantic conventions, making them fully compatible with Phoenix’s trace visualization and evaluation features.

Privacy Configuration

If you need to hide sensitive data, use the instrumentor directly instead of auto_instrument:

Resources