{"version":"2.1.283","anchor":"headlesssdk-result-usage-also-counts-usage-from-assistant-m","canonical_anchor":"headlesssdk-result-usage-also-counts-usage-from-assistant-m","heading":"Headless and SDK results now count usage from responses that were not streamed","tier":"notice","area":"Agents","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.283\/e\/headlesssdk-result-usage-also-counts-usage-from-assistant-m","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.283","markdown":"### Headless and SDK results now count usage from responses that were not streamed\n\nWhen run headless or through the SDK, the final result's usage total now includes assistant replies that arrived without stream events\n\n**Unclear.** It is not settled that this corrects under-reported usage in practice, or which sessions hide informational system messages.\n\n**What**\n\nWhen Claude Code runs headless (without its interactive screen, for example from a script) or through the SDK (the programming library for driving Claude Code from your own code), it reports a final result that includes a usage total. Usage is the count of tokens, the units of text the model processes and bills by.\n\nThat total used to come only from streamed responses, which arrive piece by piece as they are generated. Claude Code now also adds the usage of any assistant reply that was not already counted that way, so replies that arrive whole are included.\n\nIn the same part of Claude Code, system messages marked as informational are now held back from the output in some sessions.\n\n**Why**\n\nIf a response arrived without streaming, its tokens could be missing from the reported usage, which would make usage and cost look lower than they were. Scripts that read the usage figure from results may now see higher, more complete numbers.\n\n- Area: Agents\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5"}