Available for: Python and TypeScript.
Anthropic client instance with wrapAnthropic() (TypeScript), or patch the anthropic module with patch_anthropic() (Python). Every messages.create call is traced automatically, including tool use and streaming responses.
Installation
Setup
wrapAnthropic() returns a wrapped client instance — pass it to any function that makes Anthropic calls, and use it exactly like the original client. In Python, patch_anthropic() monkey-patches anthropic.resources.messages.Messages.create in place, so anthropic.Anthropic() (constructed after patching) is traced automatically with no wrapping step.
Example
What gets captured
Tool use
Tool calls and tool results are captured as child spans under the message span, in both languages.Streaming
Streaming responses are traced end-to-end in both languages. Token counts accumulate frommessage_delta events.
In Python,
patch_anthropic() only patches messages.create() — including calls made with stream=True. It does not patch the separate messages.stream() context-manager helper, so use create(..., stream=True) and iterate over the raw typed events (event.type, e.g. content_block_delta) as shown above to get traced streaming.Prompt and completion text is stored by default with PII redaction applied before transmission. Set
storePrompts: false (store_prompts=False in Python) in zespan.init() to disable prompt storage.Next steps
- Agent tracing — trace multi-turn Claude conversations as agents
- Guardrails — enforce safety policies on Claude outputs

