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 · api

migration-guide changedmodels/sonnet-5-5/migration-guide

Nearest release: v2.1.334, published 11 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+17added
Lines−21removed
From line 147 where the diff opens
First seen 29 Sep 2026 this site's first read of the page
Recorded edits31to this page, all time

The whole hunk

from line 147, old and new numbered
/
lines
from line 147
147147 ```
148148 
149149 ```java Java
150 import com.anthropic.models.messages.OutputConfig;
150 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
151151 
152 void main() {
153 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
152 MessageCreateParams params = MessageCreateParams.builder()
153 .model(Model.CLAUDE_SONNET_5_5)
154 .maxTokens(4096L)
155 .addUserMessage("Analyze the trade-offs between microservices and monolithic architectures")
156 .outputConfig(OutputConfig.builder()
157 .effort(OutputConfig.Effort.MEDIUM)
158 .build())
159 .build();
154160 
155 MessageCreateParams params = MessageCreateParams.builder()
156 .model(Model.CLAUDE_SONNET_5_5)
157 .maxTokens(4096L)
158 .addUserMessage("Analyze the trade-offs between microservices and monolithic architectures")
159 .outputConfig(OutputConfig.builder()
160 .effort(OutputConfig.Effort.MEDIUM)
161 .build())
162 .build();
163 
164 Message response = client.messages().create(params);
165 response.stopReason().ifPresent(reason -> IO.println("Stop reason: " + reason));
166 response.content().stream()
167 .flatMap(block -> block.text().stream())
168 .forEach(textBlock -> IO.println(textBlock.text()));
169 }
161 Message response = client.messages().create(params);
162 response.stopReason().ifPresent(reason -> IO.println("Stop reason: " + reason));
163 response.content().stream()
164 .flatMap(block -> block.text().stream())
165 .forEach(textBlock -> IO.println(textBlock.text()));
170166 ```
171167 
172168 ```php PHP
from line 1214
12181214 
12191215### Migrating from Claude Sonnet 4 or earlier
12201216 
1221Claude Sonnet 4 is retired on the Claude API but available on Claude Models on Google Cloud (Google managed) and Amazon Bedrock. Claude 3.7 Sonnet is retired. From either model, first apply every preceding section, then these changes:
1217First, apply every preceding section. Then, make these changes:
12221218 
12231219* **Tool versions:** Use `text_editor_20250728`, with the tool name `str_replace_based_edit_tool` and no `undo_edit` command. Use `code_execution_20260521`. See the [text editor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/text-editor-tool) and the [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#upgrade-to-latest-tool-version).
12241220* **Stop reasons:** Handle `refusal`. Claude 4.5 and later models also stop with `model_context_window_exceeded` at the context window limit. See [Stop reasons and fallback](https://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons).
Feedback