Sweep 19 Sep 2026 · 02:36Z Build v2.1.278 500 read Stable v2.1.267 Latest v2.1.278 Next v2.1.278 Feeds RSS JSON llms.txt Unofficial
Claude Code v2.1.277 ·

New SDK query() usage/cost fields get detailed docs

SDK docs now spell out that query() usage and cost totals accumulate across turns and reset on /clear

TierUnder the hoodhow much it should matter to you
Useful1my rating, 1 to 5
Signal1worth watching, 1 to 5
AreaSDKwhat it touches
KindInternal Changesin v2.1.277,
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.

How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agreeFixed sessions continued after /clear (restart, --continue, --resume) missing part of their first message when a SessionStart hook printed…

See this entry in the whole of v2.1.277 →