Under the hood
SDK docs now spell out that query() usage and cost totals accumulate across turns and reset on /clear
What
The descriptions for the SDK's query() result fields covering model usage and total cost have been expanded. They now explain that per-model token totals (modelUsage) and the cumulative estimated cost (totalCostUsd-like field) both accumulate across turns within a streaming session, and reset when /clear is used to start a new conversation.
Why
This clarifies for SDK users exactly what window of activity these numbers cover, so a running cost or usage total isn't mistaken for a single-turn figure or misunderstood after a /clear.
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agree
Fixed sessions continued after /clear (restart, --continue, --resume) missing part of their first message when a SessionStart hook printed…