Anthropic Fixes a Usage-Tracking Bug in the Claude Agent SDK That Was Quietly Breaking Cost Reports

Version 0.3.277 of the Claude Agent SDK for TypeScript patches a bug that reset usage totals to zero on resumed or forked sessions, meaning your cost dashboards may have been quietly wrong.

Anthropic Fixes a Usage-Tracking Bug in the Claude Agent SDK That Was Quietly Breaking Cost Reports

If you’re running the Claude Agent SDK for TypeScript in production, and specifically if your agents resume or fork sessions, you’ll want to bump your version today. Anthropic shipped v0.3.277 on September 18, and buried in the changelog is a fix for a bug that’s been quietly corrupting usage data for anyone building long-running or branching agent workflows.

What the Claude Agent SDK actually does

For anyone catching up: the Claude Agent SDK is Anthropic’s official framework for building autonomous agents in Python and TypeScript. It’s the same “agent loop” architecture that powers Claude Code, unbundled and handed to developers who want to build their own coding assistants, research agents, or customer support bots without reinventing tool-call handling, context management, and permissioning from scratch. Anthropic renamed it from the Claude Code SDK last year once it became clear the underlying harness was useful for basically any agentic task, not just writing code.

That framing matters here, because usage accounting isn’t a nice-to-have in an SDK meant to run unattended, often with real budget caps attached.

The bug, and why it mattered

The core fix addresses a scenario that’s common in production agent design: resuming a session, or forking one to run parallel branches of a task. According to the release notes, a resumed or forked session’s total_cost_usd, modelUsage, and get_usage totals were resetting to zero instead of continuing to accumulate from earlier turns. The maxBudgetUsd enforcement itself wasn’t affected, so nobody was silently blowing past their spending caps. What broke was the reporting on top of it: any dashboard, billing pipeline, or internal chargeback system reading those totals was getting numbers that understated real usage the moment a session resumed.

That’s a subtle failure mode. Nothing crashes. No error gets thrown. The agent keeps working fine. Your cost graphs just start lying to you, quietly, in a way that’s easy to miss until someone reconciles an invoice against what the SDK reported and the numbers don’t line up.

The second fix is related and arguably more important for anyone building serious observability around their agents. SDKUsageReport rows now always carry severity and is_active fields, and the report only relays rows pulled from a live server reply. Previously, a failing usage fetch could apparently still produce rows, meaning a broken telemetry pipeline could hand you data that looked current but wasn’t. Now, when the fetch fails, you get nothing instead of something stale masquerading as fresh.

Why usage accuracy is not optional in production agents

It’s worth stating plainly why this class of bug matters more for agent frameworks than for a typical API integration. Agentic workflows loop, retry, spawn subagents, and resume across sessions, often unsupervised for stretches at a time. Anyone evaluating the best AI agent frameworks for 2026 is going to weigh cost predictability alongside capability, because an agent that reasons well but reports its own resource consumption incorrectly is a liability at scale, not a convenience.

Token and cost tracking underpins the guardrails teams actually rely on: budget alerts, per-customer usage billing, anomaly detection for runaway loops. If the numbers feeding those systems are wrong, the guardrails are decorative. A team could reasonably believe a workflow costs a fraction of what it does, right up until finance asks questions.

None of this is unique to Anthropic’s SDK, to be fair. Usage telemetry bugs are an occupational hazard of any framework built around long-lived, stateful agent sessions. But it’s a good reminder that “agent framework maturity” isn’t just about tool-calling reliability or context window tricks. It’s also about the unglamorous plumbing that tells you what any of it actually costs.

What to do about it

The fix ships in v0.3.277, which also brings the SDK to parity with Claude Code v2.1.277 and adds a handful of smaller items (pasted-content tracking in user messages, latency fields for remote sessions, an effortLevel setting via updateSettings()). Updating is a one-line change:

npm install @anthropic-ai/claude-agent-sdk@0.3.277

If your agents resume sessions, fork them, or feed usage data into anything a human or a billing system trusts, this is the kind of patch you apply the same day you read about it, not the next time you happen to be in that part of the codebase.

Get the AI Tech Watch

The biggest AI stories and worthwhile deals. No daily inbox carpet bombing.