---
title: Claude Agent SDK
seo:
  title: Claude Agent SDK — Python SDK
---

## setup\_claude\_agent\_sdk()

Patch the Claude Agent SDK for automatic tracing.

Monkey-patches `ClaudeSDKClient` and the standalone `query()`
function so every agent turn, LLM call, and tool invocation is
recorded as a span. Call this once at startup, before any SDK usage.

```python
from judgeval import Tracer
from judgeval.integrations import setup_claude_agent_sdk

Tracer.init(project_name="my-agent")
setup_claude_agent_sdk()

# All Claude Agent SDK calls are now traced automatically
```

```python
def setup_claude_agent_sdk() -> bool:
```

### Returns

`bool` - True if patching succeeded, False on error.
