{"version":"2.1.273","anchor":"token-usage-accumulation-in-agent-execution-now-validates-us","canonical_anchor":"token-usage-accumulation-in-agent-execution-now-validates-us","heading":"Token-usage accumulation in agent execution now validates usage shape before summing","tier":"internal","area":"Telemetry","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.273\/e\/token-usage-accumulation-in-agent-execution-now-validates-us","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.273","markdown":"### Token-usage accumulation in agent execution now validates usage shape before summing\n\nToken usage totals for an agent turn are now validated before being added up, to avoid bad data corrupting the count\n\n**What**\n\nWhen Claude Code tallies up token usage during an agent's turn, it now checks the shape of the usage data first: it requires `input_tokens` to be a number, and treats a missing or null `output_tokens` as 0. Only after this check does it sum input, cache-creation, cache-read, and output tokens, instead of summing the raw values directly.\n\n**Why**\n\nThis guards against malformed or incomplete usage data silently corrupting token counts or causing errors, keeping usage totals reliable.\n\n- Area: Telemetry\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}