Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Claude Code gateway compatibility guide changedllm-gateway-protocol

Nearest release: v2.1.334, published 3 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Upstream edited this page at 1 Dec 2026 22:26 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 1 Dec 2026 22:37 UTC.

Upstream edited
Recorded here
Lines+20added
Lines−1removed
From line 144 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits60to this page, all time

#### Retry unchanged, then without earlier thinking

The whole hunk

from line 144, old and new numbered
/
lines
from line 144
144144| :- | :- |
145145| `x-claude-code-request-class` | What kind of request this is: `main` for a turn of the main conversation, `subagent` for a turn of a [subagent](https://code.claude.com/docs/en/sub-agents.md), `workflow` for an agent running inside a workflow, `compaction` for the summarization request that compacts a conversation, or `auxiliary` for side requests such as session titles, classifiers, and summaries. Sent on every request |
146146| `x-claude-code-agent-type` | The kind of subagent that issued the request: a built-in agent type name such as `Explore`, `Plan`, or `general-purpose`, or `custom` for a user-defined agent, `teammate` for an [agent team](https://code.claude.com/docs/en/agent-teams.md) member running in the lead's process, or `fork` for a [fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation). Present only on a subagent's own turns; a subagent's compaction or side requests keep the agent ID but carry no type. A user-chosen agent name is never sent |
147| `x-claude-code-compaction` | Present on the request that summarizes the conversation during a [compaction](https://code.claude.com/docs/en/prompt-caching.md#compacting-the-conversation). The value says what triggered it: `auto` when the context window approached capacity, `manual` for `/compact`, or `reactive` when the API rejected a request as too long. The value is also `auto` for [idle compaction](https://code.claude.com/docs/en/settings-reference.md#idlecompaction) in an interactive terminal session. Absent on every other request, including one that writes a summary in the background before a compaction |
147| `x-claude-code-compaction` | Present on the request that summarizes the conversation during a [compaction](https://code.claude.com/docs/en/prompt-caching.md#compacting-the-conversation). The value says what triggered it: `auto` when the conversation approached the [auto-compact window](https://code.claude.com/docs/en/model-config.md#context-window-and-auto-compaction), `manual` for `/compact`, or `reactive` when the API rejected a request as too long. The value is also `auto` for [idle compaction](https://code.claude.com/docs/en/settings-reference.md#idlecompaction) in an interactive terminal session. Absent on every other request, including one that writes a summary in the background before a compaction |
148148| `x-claude-code-context-compacted` | Present once, on the first main-conversation request after a compaction, with the same values as `x-claude-code-compaction`. The conversation prefix before this request is no longer used, so a cache keyed on it can be dropped |
149149| `x-claude-code-prev-tool-durations` | Measured run time of the tool calls whose results this request carries, as `<name>=<ms>;<name>=<ms>`, for example `Bash=742;Read=9`. Sent on the next request of the same conversation after a batch of tool calls, from the main session or a subagent |
150150| `x-claude-code-prompt-id` | Random UUID that identifies the user prompt a request serves. Requests serving one prompt share the value, including the turns of subagents that prompt started. Requests not attributed to a prompt omit it. Use it to group a session's requests by prompt. Requires Claude Code v2.1.283 or later |
from line 245
245245The `bound to a different conversation` rejection comes from the API's [preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking) check, which fails when `system`, `tools`, or earlier `messages` content differs from the request that produced the thinking. A gateway that rewrites any of that content can cause the rejection itself; [Libraries, proxies, and gateways](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#libraries-proxies-gateways) covers what to pass through unchanged.
246246 
247247Most of this retry logic matches on the upstream's error wording, so forward error response bodies unmodified. A gateway that wraps upstream errors in its own envelope breaks the recovery path, even when it preserves the status code, unless the envelope's message carries a stable `capability_rejected:` token. [Claude apps gateway substitutes those tokens for cloud providers' error wording](https://code.claude.com/docs/en/claude-apps-gateway-config.md#upstream-error-messages), for example `capability_rejected: prompt_too_long`.
248 
249#### Retry unchanged, then without earlier thinking
250 
251If Claude Code doesn't recognize the error body of your gateway's `400` or `422`, it can retry a request that carried `thinking` or `redacted_thinking` blocks from earlier turns. Claude Code retries once in case the error was transient, and once to test whether your gateway rewrote the upstream's error body for a rejected thinking signature.
252 
253Look for the two retries in your gateway's log:
254 
2551. The same body again
2562. The same body without those blocks, sent only if your gateway answers the first retry with another `400` or `422` that Claude Code doesn't recognize
257 
258Find your gateway's response to the retries in the first column:
259 
260| Your gateway | What follows | What you do |
261| :- | :- | :- |
262| Accepts the first retry | Later requests still carry those blocks | Nothing |
263| Rejects the first retry, then accepts the second | Later requests omit those blocks too | Nothing, unless your gateway rewrites the upstream's error bodies. Then forward them unmodified, or put `capability_rejected: thinking_signature` in the rewritten message when the upstream rejects a thinking signature. Claude Code then recognizes the rejection and sends [a single retry without the blocks](#automatic-retry-and-error-forwarding). |
264| Rejects both retries | Another retry of the same request can follow, such as the [retry without tool search](#retry-without-tool-search). If none does, the developer sees the original error, followed by `If other sessions work and this one keeps failing, start a new session`. Later requests carry those blocks again. | If your gateway rewrites the upstream's error bodies, forward them unmodified, so that Claude Code can recognize the error. Otherwise, nothing. |
265 
266To disable both retries, for example because your gateway rejects requests itself under a content policy, have developers set [`CLAUDE_CODE_DISABLE_REPLAYED_THINKING_PROBE`](https://code.claude.com/docs/en/env-vars) to `1`, which requires Claude Code v2.1.334 or later. With the retries disabled, a conversation that the second retry would have recovered keeps failing until the developer starts a new session.
248267 
249268#### Retry without a rejected beta value
250269 
Feedback