query() during setup() before import.
TypeScript uses an explicit wrapper because ESM namespace bindings cannot be
safely patched in place.
If your app shells out to the claude binary instead of importing
@anthropic-ai/claude-agent-sdk or claude_agent_sdk, use
Claude Code SDK traces.
Install
TypeScript Wrapped Query
TypeScript
Python Query Loop
Python
What To Look For
- An AGENT span for the query run
- Nested LLM turns from the Claude Agent SDK
- Tool-use and tool-result data when built-in tools are used
- Final assistant output captured on the span