Looking for Python? See the Python guide.
Install
Setup
To instrument your Claude Agent SDK application, use theregister function from @arizeai/phoenix-otel and set up the Claude Agent SDK instrumentation.
Create the instrumentation.ts file:
The Claude Agent SDK is ESM-only, so
manuallyInstrument() is used instead of enable(). Because ES module exports are read-only, the instrumentation can’t patch the SDK in place — manuallyInstrument() returns an instrumented copy of the module instead. Call query() on that returned copy. If you import query directly from @anthropic-ai/claude-agent-sdk, no spans are created.Usage
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
Privacy Configuration
You can configure the instrumentation to hide sensitive data usingtraceConfig:

