DEV Community

Manu Shukla
Manu Shukla

Posted on Originally published at ecorpit.com

Claude Code 2.1.239 fixed silent Bedrock double-billing, but the stable channel is 9 releases behind

Claude Code 2.1.239 fixed silent Bedrock double-billing, but the stable channel is 9 releases behind

Summary. Claude Code 2.1.239, published to npm on 21 August 2026 at 17:18 UTC, fixed a defect described in its own changelog as one that "silently doubled billed API calls by re-running every turn non-streaming" when Amazon Bedrock traffic passed through a proxy that strips the response Content-Type header. As of 23 August 2026, the stable dist-tag on the @anthropic-ai/claude-code npm package still resolves to 2.1.231, published 13 August 2026 at 08:27 UTC. That is 9 published versions and 10 days behind the latest tag, which sits at 2.1.240. Anthropic's own setup documentation describes the stable channel as "a version that is typically about one week old". Two separate billing fixes landed inside the gap: the Bedrock streaming fix in 2.1.239 and a prompt-caching fix for gateway users in 2.1.237. Anthropic's cost guidance puts enterprise Claude Code spend at roughly $13 per developer per active day and $150 to $250 per developer per month, so a doubling that runs unnoticed for ten days is not a rounding error on a 200-seat deployment.

What the changelog actually says

The anthropics/claude-code CHANGELOG entry for 2.1.239 lists, among its fixes:

Fixed Bedrock streaming behind proxies that strip the response Content-Type header, which silently doubled billed API calls by re-running every turn non-streaming

Two words in that line carry the cost. "Silently" means no error was surfaced to the developer. "Every turn" means the doubling was not an edge case inside a session; it applied to the whole session, for as long as the misconfigured proxy sat in the path.

The same release also changed how /cost, the status line and --max-budget-usd compute their figures, so they now include the 1.1x US-only-inference premium that applies to data-residency workspaces. A team on a residency workspace that was reading /cost before 2.1.239 was reading a number 10% below its actual list-rate spend, independently of the Bedrock defect.

Why a proxy causes it at all

Amazon Bedrock does not stream in server-sent events. Claude Code's Bedrock documentation states that Bedrock "streams responses in a binary event-stream format with the content-type application/vnd.amazon.eventstream", and that Claude Code "rejects a successful streaming response that reports a different content-type instead of decoding a body it can't read".

The documented failure mode is loud. The troubleshooting section tells you the error begins Bedrock streaming response has content-type and names the type it received, "commonly text/event-stream from an Amazon API Gateway and Lambda integration that re-emits the stream as server-sent events". Anthropic's documented remedy is to configure the gateway to pass the InvokeModelWithResponseStream response body and its Content-Type header through unmodified, or, where only the header is rewritten and the binary body arrives intact, to set CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD=1 until the gateway is fixed.

That is the gap worth naming. The troubleshooting page describes a guard that stops and tells you. The 2.1.239 changelog describes a path where the same misconfiguration produced no error at all and instead re-ran the turn without streaming, billing it twice. Both statements are Anthropic's. A team that read the troubleshooting page and saw no Bedrock streaming response has content-type error in its logs would reasonably have concluded it was unaffected.

There is precedent for this defect class changing shape between releases. The same documentation records that "before v2.1.208, the same misconfiguration surfaced as API Error: Truncated event message received after the whole response had been buffered". The underlying proxy problem has now presented three different ways across three version ranges.

Claude Code uses the Bedrock Invoke API and does not support the Converse API, and its documented IAM policy requires both bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream. Any organisation that terminates that call at an API Gateway, a corporate egress proxy or an in-house LLM gateway is in the affected population.

Who is exposed, and how to tell if that is you

Three conditions have to hold together. First, CLAUDE_CODE_USE_BEDROCK=1. Second, something between Claude Code and Bedrock that rewrites response headers. Third, a client version below 2.1.239.

The third condition is the one most teams get wrong, because they believe an auto-updater has handled it. Claude Code's autoUpdatesChannel setting takes "latest" as its default, but the documentation notes that for enterprise deployments "you can enforce a consistent release channel across your organization using managed settings". Enforcing stable is exactly what a change-controlled organisation does. It is also the same population most likely to run an egress proxy in front of Bedrock.

Homebrew installs split the same way by cask name rather than by setting: claude-code tracks stable and claude-code@latest tracks latest. The documentation is explicit that "Homebrew installations do not auto-update", and the same applies to WinGet and Linux package manager installs, which "require manual updates by default".

Install path Channel followed Auto-updates Has the 2.1.239 fix on 23 Aug 2026
Native install, default settings latest Yes, in background Yes, 2.1.240
Native install, autoUpdatesChannel: "stable" stable Yes, to 2.1.231 No
Homebrew cask claude-code stable No, manual brew upgrade No
Homebrew cask claude-code@latest latest No, manual brew upgrade Only after a manual upgrade
WinGet or Linux package manager as packaged No, manual Only after a manual upgrade

Checking your own position takes one command against the public npm registry and one against your machine:

# What the tags resolve to right now
npm view @anthropic-ai/claude-code dist-tags

# What you are actually running
claude --version
claude doctor
Enter fullscreen mode Exit fullscreen mode

On 23 August 2026 the registry returns stable: 2.1.231, latest: 2.1.240 and next: 2.1.241, with publish timestamps of 2026-08-13T08:27:21Z for 2.1.231 and 2026-08-22T13:03:23Z for 2.1.240.

The second billing fix in the same gap

Version 2.1.237, published 19 August 2026 at 23:57 UTC, carries a one-line entry: "Fixed prompt caching for sessions using an LLM gateway or custom base URL." It is also above the stable pin.

Prompt caching is where most of the saving in a long Claude Code session comes from. On Anthropic's published list rates as of August 2026, Claude Sonnet 5 base input is $2 per million tokens and a cache hit is $0.20 per million, a tenfold difference. On Claude Opus 5 the split is $5 against $0.50. A session that reads 940,000 cached tokens, the shape shown in Anthropic's own /usage example output, costs a very different amount depending on whether those reads register as hits.

Claude Code can tell you. The /usage command shows behaviour flags, and the documentation states that behaviours "such as long context or cache misses" are "flagged when one accounts for 10% or more of recent usage". For a team behind a gateway on a pre-2.1.237 build, that flag is the cheapest available signal.

Model, list rate August 2026 Base input Cache hit or refresh Output
Claude Opus 5 $5 / MTok $0.50 / MTok $25 / MTok
Claude Sonnet 5 $2 / MTok $0.20 / MTok $10 / MTok
Claude Haiku 4.5 $1 / MTok $0.10 / MTok $5 / MTok

One caution on reading the local figure. Anthropic's cost documentation states that Claude Code "computes the dollar figure locally from token counts priced at standard list rates, so it doesn't reflect promotional pricing or contracted discounts and may differ from your actual bill", and that /usage totals "are approximate and computed from local session history on this machine". For a Bedrock deployment the authoritative record is AWS billing, not the terminal. If you are attributing Bedrock spend properly, per-principal cost allocation on the Bedrock endpoints is the mechanism that survives an audit.

What to do this week

Move the pin, or move the floor. Anthropic documents a minimumVersion setting where "background auto-updates and claude update refuse to install any version below this value, so moving to the "stable" channel does not downgrade you if you are already on a newer "latest" build". Setting minimumVersion to 2.1.239 keeps a change-controlled fleet on the stable channel while guaranteeing the billing fix is present. That is the change most teams should make, because it does not require abandoning the release discipline that put them on stable in the first place.

Then check the proxy. If an API Gateway and Lambda integration sits in front of InvokeModelWithResponseStream, it re-emits the stream as server-sent events by default, and that is the exact configuration Anthropic names. Pass the body and the Content-Type header through unmodified rather than reaching for the guard-disabling environment variable, because the documentation is clear that with the check off "a response body that was transformed fails with Truncated event message received again".

Finally, reconcile. Compare Bedrock invocation counts for the 13 to 21 August window against sessions recorded locally. A silent non-streaming re-run of every turn should show as roughly two InvokeModel family calls per turn where you expect one. The real cost here is usually the reconciliation, not the upgrade.

India-specific considerations

Indian delivery centres running Claude Code against Bedrock typically route egress through a managed proxy for DPDP and client-contract reasons, which places them squarely in the affected configuration. Two points follow. Rupee exposure on a 50-developer team at the documented $150 to $250 per developer per month is roughly $7,500 to $12,500 a month before any doubling, so a ten-day undetected doubling on part of that base is a material line item rather than a footnote. And where the proxy exists to keep request and response bodies inside a specific jurisdiction, disabling the content-type guard is the wrong lever, because it trades a billing defect for an unverified body transformation. Fix the proxy configuration and raise minimumVersion.

What is still unknown

Anthropic has not published the version range in which the silent double-billing behaviour was introduced, only the version in which it was fixed. The changelog entry does not say whether the re-run consumed the same input tokens as the streaming attempt or a re-primed context, so the exact multiplier on a real bill is not derivable from published material. It is also not stated whether the stable dist-tag will advance to a build above 2.1.239 on its usual cadence or be advanced early because of this fix. Teams should verify npm view @anthropic-ai/claude-code dist-tags themselves rather than assume either.

FAQ

Which Claude Code version fixed the silent Bedrock double-billing?

Version 2.1.239, published to npm on 21 August 2026 at 17:18 UTC. Its changelog entry describes a fix for Bedrock streaming behind proxies that strip the response Content-Type header, a defect that silently doubled billed API calls by re-running every conversational turn without streaming enabled.

Why does the stable channel not have the fix yet?

Anthropic's setup documentation describes the stable channel as a version typically about one week old that skips releases with major regressions. On 23 August 2026 the npm stable dist-tag resolves to 2.1.231, published 13 August, which predates both 2.1.237 and 2.1.239 and therefore contains neither billing fix.

How do I check which release channel my installation follows?

Run claude doctor and inspect the autoUpdatesChannel value in your settings file. The default is latest. Homebrew installations choose by cask name instead: claude-code tracks stable and claude-code@latest tracks latest. WinGet and Linux package manager installs do not auto-update at all and need manual upgrades.

Can I stay on stable and still get the fix?

Yes. Anthropic documents a minimumVersion setting that establishes a floor, and background auto-updates and claude update refuse to install any version below that value. Setting it to 2.1.239 keeps a change-controlled fleet on the stable channel while guaranteeing that the Bedrock billing fix is present on every machine.

What content-type does Amazon Bedrock actually stream?

Bedrock streams responses in a binary event-stream format with the content-type application/vnd.amazon.eventstream. Claude Code rejects a successful streaming response reporting any other type rather than decoding a body it cannot read. Proxies commonly rewrite it to text/event-stream, which is what an API Gateway and Lambda integration emits.

Should I set CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD to 1?

Only as a temporary measure where the gateway rewrites the header alone and passes the binary body through intact. Anthropic's documentation states that with the check off, a response body that was actually transformed fails with a truncated event message error again. Correcting the gateway configuration is the durable fix here.

What was the second billing fix inside the version gap?

Version 2.1.237, published 19 August 2026, fixed prompt caching for sessions using an LLM gateway or custom base URL. Caching matters because a Claude Sonnet 5 cache hit lists at $0.20 per million tokens against $2 per million for base input, a tenfold difference on the largest component of a long session.

How do I detect a caching problem without reading the bill?

The /usage command in Claude Code shows behaviour flags, and cache misses are flagged when they account for 10% or more of recent usage. Those figures are approximate and computed from local session history on one machine, so treat them as a signal to investigate rather than an authoritative billing record.

How eCorpIT can help

eCorpIT runs cloud cost and AI-tooling reviews for engineering organisations using Claude Code, Amazon Bedrock and self-hosted LLM gateways, including release-channel policy, egress proxy configuration and per-principal spend attribution. We are CMMI Level 5 and ISO 27001:2022 certified, and design deployments aligned with DPDP requirements for Indian delivery centres. If your Bedrock invocation counts have moved without a matching change in developer activity, book a Bedrock spend reconciliation and we will work the August window with you.

Related reading: cloud FinOps for Indian engineering teams, AI cloud cost control across AWS, Azure and GCP, Bedrock per-principal cost allocation and governing Claude Code through a gateway.

References

  1. Claude Code CHANGELOG, anthropics/claude-code — entries for 2.1.237, 2.1.238, 2.1.239 and 2.1.240, retrieved 23 August 2026.
  2. npm registry metadata for @anthropic-ai/claude-code — dist-tags and publish timestamps, retrieved 23 August 2026.
  3. Claude Code on Amazon Bedrock, Anthropic — streaming errors behind a gateway or proxy, Invoke API, IAM actions.
  4. Set up Claude Code, Anthropic — release channels, autoUpdatesChannel, minimumVersion, Homebrew casks.
  5. Manage costs effectively, Anthropic — per-developer spend figures, /usage behaviour flags, local list-rate caveat.
  6. Other LLM gateways, Anthropic — what a gateway forwards and who is billed for gateway traffic.
  7. Claude pricing, Anthropic — per-million-token list rates and cache multipliers, August 2026.
  8. Amazon Bedrock InvokeModelWithResponseStream API reference, AWS — the streaming operation Claude Code calls.
  9. Cross-region inference profiles, AWS — profile IDs Claude Code resolves per region.
  10. Claude Code network configuration, Anthropic — proxy and egress configuration for Claude Code.
  11. Claude Platform release notes, Anthropic — August 2026 platform changes, retrieved 23 August 2026.

Last updated: 23 August 2026.

Top comments (0)