Agent frameworks

    Claude Agent SDK tracing for Python

    Out-of-process agent runs are still traced: the wrapper reads tokens, cost and latency from the ResultMessage.

    Set up Claude Agent SDK

    The snippet is copied from the SDK README, not paraphrased. Keys shown as tk_live_... are the environment key from Settings › Environments.

    Python
    import evalkit
    
    evalkit.init(
        subscription_key="tk_live_...",   # Dashboard → Settings → Tracing
        service_name="my-service",
    )

    Copied from sdk-py/README.md § Quick start

    Install → first trace

    1. 01

      Install the SDK

      pip install syntropylabs-evalkit or npm install syntropylabs-evalkit.

    2. 02

      Call init() once

      Pass your environment key and a service name, as early as possible in the process, before other modules run requests.

    3. 03

      Run one query() with the Claude Agent SDK

      No wrapper and no decorator: the call is traced automatically with model, latency and tokens.

    4. 04

      Open the first trace

      Traces shows the call as a span; the environment’s quickstart page ticks when it arrives.

    What a turn looks like

    Sample data in the product’s own table. Hover, focus or tap a claim to see the columns it points at.

    Sample run

    Operation Service StatusModel LatencyTokens≈CostScore
    support_agent.turn8f3a1c0d94e2session sess_4b1esupport-apiokgpt-4o-mini1.84 s3,412$0.000692%auto
    refund_agent.turnc21d7e5a30b8session sess_9a02tool looprefund-workerokclaude-sonnet-44.31 s7,905$0.038968%auto
    claude-code.turn5be04f7d1a96session sess_f77cClaude Codeunsetclaude-sonnet-448.20 s61,208$0.19
    rag.answere9a2b6c4d015errordocs-boterrorgpt-4o6.02 s9,880$0.031241%auto
    voice.turn17c8d3f2a4e0session sess_20d1ivr-agentokgpt-4o-realtime0.92 s1,104$0.0071

    fig. 1 · the traces table this integration fills · sample data

    What you see

    Taken from the SDK READMEs’ coverage tables. with flag means the signal leaves your machine only when you opt in.

    What Syntropylabs shows for Claude Agent SDK
    SignalCapturedDetail
    query() and ClaudeSDKClient.receive_response() as spansyesautomatic via init() when claude_agent_sdk is installed
    Tokens, cost and latencyyesread from the ResultMessage
    Time to first token on streamsnothe model call runs in a subprocess the in-process patch cannot see
    Prompts and completionsyeson by default; capture_content=False / captureContent: false keeps every metric and drops every payload
    Your own functionsyesevery function in your app’s source tree, on by default

    Limitations

    • Python only.
    • If claude_agent_sdk is installed after init(), call evalkit.patch_claude_agent_sdk() explicitly.
    • Individual model calls inside the subprocess are not visible; the span covers the query and what the ResultMessage reports.

    Next steps

    Trace Claude Agent SDK today

    Tracing is free for one project on every plan, coding-agent traces included. Evaluations, datasets and simulation are Pro and up.