--- id: openinference-instrumentation-claude-agent-sdk version: "0.1.10" license: Apache-2.0 license_treatment: permissive maintenance: active --- # openinference-instrumentation-claude-agent-sdk — OpenInference Claude Agent SDK Instrumentation License: permissive · Maintenance: active · Downloads: 432.5K/mo ## What it is and what it does This package wraps Claude Agent SDK calls (query() and ClaudeSDKClient) with OpenTelemetry instrumentation to emit traces compatible with OpenInference conventions. Each call generates an AGENT span containing the prompt input, result output, session and model metadata, token counts, and nested TOOL spans for any tool invocations. Traces are sent to an OTLP collector—Phoenix (local or cloud), Arize AX, or any standard OpenTelemetry backend—enabling observability of agent behavior, tool usage, and LLM costs. The package uses hook injection into the Claude Agent SDK to capture tool execution (PreToolUse, PostToolUse, PostToolUseFailure events) without modifying application code beyond a single instrumentation call. It depends on openinference-instrumentation, opentelemetry-api, opentelemetry-instrumentation, and related semantic convention packages. For deeper visibility into internal Anthropic API calls within the agent, pair it with openinference-instrumentation-anthropic. Use it for: - Monitor agent query latency, token usage, and cost per call in production. - Debug multi-turn conversations by viewing the full trace of prompts, responses, and tool calls. - Analyze tool invocation patterns and failure rates across agent runs. - Export traces to Phoenix Cloud or Arize AX for centralized LLM observability dashboards. - Correlate agent spans with downstream application metrics in a unified OpenTelemetry backend. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Auto-instruments Claude Agent SDK calls to emit OpenTelemetry-compatible traces capturing prompts, results, token counts, and tool execution as OpenInference AGENT spans. Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and directly solves a concrete problem—observing Claude Agent SDK behavior in production. Install it if you run Claude agents and need traces for debugging, monitoring, or cost analysis. Pair it with openinference-instrumentation-anthropic if you also need visibility into the underlying Anthropic API calls. ## Install pip install openinference-instrumentation-claude-agent-sdk uv add openinference-instrumentation-claude-agent-sdk poetry add openinference-instrumentation-claude-agent-sdk ## Installing openinference-instrumentation-claude-agent-sdk Before you install: Low friction: pure Python wheel with standard OpenTelemetry dependencies. Actively maintained (released 2026-08-12, last commit 2026-08-14) with no known vulnerabilities. License in practice: Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions. Quickstart: pip install openinference-instrumentation-claude-agent-sdk from openinference.instrumentation.claude_agent_sdk import ClaudeAgentSDKInstrumentor from opentelemetry.sdk import trace as trace_sdk from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.trace.export import SimpleSpanProcessor tracer_provider = trace_sdk.TracerProvider() tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint))) ClaudeAgentSDKInstrumentor().instrument(tracer_provider=tracer_provider) Requires Claude Agent SDK and an OTLP collector endpoint (local Phoenix, Phoenix Cloud, or Arize AX) to send traces. Verify before relying: - Whether traces from query() and ClaudeSDKClient.receive_response() are automatically correlated across multi-turn conversations. - Performance overhead of hook-based instrumentation on high-frequency tool calls. - Whether tool span context is preserved when using openinference-instrumentation-anthropic alongside this package. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 432.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags claude agent sdk tracing, opentelemetry instrumentation claude, llm observability agent spans, claude sdk monitoring, openinference agent tracing, anthropic agent instrumentation, llm trace collection, llm-observability, opentelemetry, agent-tracing [View on SkillFed](https://skillfed.io/packages/openinference-instrumentation-claude-agent-sdk) · [View on PyPI](https://pypi.org/project/openinference-instrumentation-claude-agent-sdk/)