{"id":45696,"library":"openinference-instrumentation-claude-agent-sdk","title":"OpenInference Claude Agent SDK Instrumentation","description":"OpenTelemetry-based instrumentation for the Anthropic Claude Agent SDK, enabling tracing of agent runs, tool calls, and LLM interactions with OpenInference semantics. Version 0.1.5, compatible with Python 3.10-3.14. Actively maintained by Arize AI.","status":"active","version":"0.1.5","language":"python","source_language":"en","source_url":"https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-claude-agent-sdk","tags":["openinference","claude","agent-sdk","opentelemetry","tracing"],"install":[{"cmd":"pip install openinference-instrumentation-claude-agent-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for OpenInference span attributes","package":"openinference-semantic-conventions","optional":false}],"imports":[{"wrong":"from openinference_instrumentation_claude_agent_sdk import ClaudeAgentSDKInstrumentor","symbol":"ClaudeAgentSDKInstrumentor","correct":"from openinference.instrumentation.claude_agent_sdk import ClaudeAgentSDKInstrumentor"}],"quickstart":{"code":"from openinference_instrumentation_claude_agent_sdk import ClaudeAgentSDKInstrumentor\nfrom opentelemetry import trace\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import SimpleSpanProcessor\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nimport os\n\n# Set up OpenTelemetry tracer provider\ntracer_provider = TracerProvider()\ntracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint=os.environ.get('OTEL_EXPORTER_OTLP_ENDPOINT', 'http://localhost:4318/v1/traits'))))\ntrace.set_tracer_provider(tracer_provider)\n\n# Instrument the Claude Agent SDK\nClaudeAgentSDKInstrumentor().instrument()","lang":"python","description":"Initialize OpenTelemetry and instrument the Claude Agent SDK. Requires an OTLP endpoint (e.g., Phoenix) to collect traces."},"warnings":[{"fix":"Move instrument() to the top of your script, before any anthropic imports.","message":"The instrument() call must happen before importing or using the Claude Agent SDK. Otherwise, spans will not be captured.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `ClaudeAgentInstrumentor` with `ClaudeAgentSDKInstrumentor` and update the import path.","message":"Versions prior to 0.1.5 used a different class name `ClaudeAgentInstrumentor` (without 'SDK'). The API changed in 0.1.4.","severity":"breaking","affected_versions":"<0.1.4"},{"fix":"Remove `suppress_tracing=True` from the instrument() call. It is no longer effective.","message":"The `suppress_tracing` argument in `instrument()` is deprecated in 0.1.5 and may be removed in a future version.","severity":"deprecated","affected_versions":"0.1.5"}],"env_vars":null,"search_vec":"'-3.14':35 '0.1.5':30 '3.10':34 'activ':36 'agent':3,14,19,44 'agent-sdk':43 'ai':40 'anthrop':12 'ariz':39 'base':8 'call':22 'claud':2,13,42 'compat':31 'enabl':16 'instrument':5,9 'interact':25 'llm':24 'maintain':37 'openinfer':1,27,41 'opentelemetri':7,46 'opentelemetry-bas':6 'python':33 'run':20 'sdk':4,15,45 'semant':28 'tool':21 'trace':17,47 'version':29","created_at":"2026-06-07T12:56:16.696338+00:00","updated_at":"2026-06-07T12:56:16.696338+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-claude-agent-sdk","github":"https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-claude-agent-sdk","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}