Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

mid-conversation-system-messages changedbuild-with-claude/mid-conversation-system-messages

Nearest release: v2.1.307, published 4 hours after 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+33added
Lines−57removed
From line 228 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits24to this page, all time

The whole hunk

from line 228, old and new numbered
/
lines
from line 228
228228 ],
229229 Messages =
230230 [
231 new() { Role = Role.User, Content = "Say OK." },
231 new BetaUserMessageParam { Content = "Say OK." },
232232 // Withdraw get_weather from this point onward. The block references
233233 // the tool by name instead of editing `Tools`, so earlier turns stay
234234 // byte-identical and the cache still hits.
235 new()
235 new BetaSystemMessageParam
236236 {
237 Role = Role.System,
238237 Content = new(
239238 [
240239 new BetaRequestToolRemovalBlock
from line 306
307306 
308307 ```java Java
309308 import com.anthropic.models.beta.AnthropicBeta;
310 import com.anthropic.models.beta.messages.BetaContentBlockParam;
311309 import com.anthropic.models.beta.messages.BetaMessage;
312 import com.anthropic.models.beta.messages.BetaMessageParam;
313310 import com.anthropic.models.beta.messages.BetaRequestToolRemovalBlock;
311 import com.anthropic.models.beta.messages.BetaSystemMessageParam.Content.SystemMessageContentBlock;
314312 import com.anthropic.models.beta.messages.BetaTool;
315313 import com.anthropic.models.beta.messages.MessageCreateParams;
316314 // ...
from line 338
340338 // Withdraw get_weather from this point onward. The block references
341339 // the tool by name instead of editing `tools`, so earlier turns stay
342340 // byte-identical and the cache still hits.
343 .addMessage(BetaMessageParam.builder()
344 .role(BetaMessageParam.Role.SYSTEM)
345 .contentOfBetaContentBlockParams(List.of(
346 BetaContentBlockParam.ofToolRemoval(BetaRequestToolRemovalBlock.builder()
347 .referenceTool("get_weather")
348 .build())))
349 .build())
341 .addSystemMessageOfBlocks(List.of(
342 SystemMessageContentBlock.ofToolRemoval(BetaRequestToolRemovalBlock.builder()
343 .referenceTool("get_weather")
344 .build())))
350345 .build();
351346 
352347 BetaMessage response = client.beta().messages().create(params);
from line 714
719714 ],
720715 Messages =
721716 [
722 new() { Role = Role.User, Content = "How many orders shipped yesterday?" },
717 new BetaUserMessageParam { Content = "How many orders shipped yesterday?" },
723718 // Define db_query by value from this point onward. `Tools` and the
724719 // earlier messages stay exactly as sent, so the cache still hits.
725 new()
720 new BetaSystemMessageParam
726721 {
727 Role = Role.System,
728722 Content = new(
729723 [
730724 new BetaRequestToolAdditionBlock
from line 814
820814 
821815 ```java Java
822816 import com.anthropic.models.beta.AnthropicBeta;
823 import com.anthropic.models.beta.messages.BetaContentBlockParam;
824817 import com.anthropic.models.beta.messages.BetaMessage;
825818 import com.anthropic.models.beta.messages.BetaRequestToolAdditionBlock;
819 import com.anthropic.models.beta.messages.BetaSystemMessageParam.Content.SystemMessageContentBlock;
826820 import com.anthropic.models.beta.messages.BetaTool;
827821 import com.anthropic.models.beta.messages.MessageCreateParams;
828822 // ...
from line 858
864858 .addUserMessage("How many orders shipped yesterday?")
865859 // Define db_query by value from this point onward. `tools` and the
866860 // earlier messages stay exactly as sent, so the cache still hits.
867 .addSystemMessageOfBetaContentBlockParams(List.of(
868 BetaContentBlockParam.ofToolAddition(BetaRequestToolAdditionBlock.builder()
861 .addSystemMessageOfBlocks(List.of(
862 SystemMessageContentBlock.ofToolAddition(BetaRequestToolAdditionBlock.builder()
869863 .definitionTool(dbQueryTool)
870864 .build())))
871865 .build();
from line 1296
13021296 ],
13031297 Messages =
13041298 [
1305 new() { Role = Role.User, Content = "What's on my calendar tomorrow?" },
1299 new BetaUserMessageParam { Content = "What's on my calendar tomorrow?" },
13061300 // Make the calendar server's tools available from this point onward.
13071301 // The block names the server; it never holds a URL or token.
1308 new()
1302 new BetaSystemMessageParam
13091303 {
1310 Role = Role.System,
13111304 Content = new(
13121305 [
13131306 new BetaRequestToolAdditionBlock
from line 1400
14071400 
14081401 ```java Java
14091402 import com.anthropic.models.beta.AnthropicBeta;
1410 import com.anthropic.models.beta.messages.BetaContentBlockParam;
14111403 import com.anthropic.models.beta.messages.BetaMcpTool;
14121404 import com.anthropic.models.beta.messages.BetaMcpToolset;
14131405 import com.anthropic.models.beta.messages.BetaMessage;
14141406 import com.anthropic.models.beta.messages.BetaRequestMcpServerUrlDefinition;
14151407 import com.anthropic.models.beta.messages.BetaRequestToolAdditionBlock;
1408 import com.anthropic.models.beta.messages.BetaSystemMessageParam.Content.SystemMessageContentBlock;
14161409 import com.anthropic.models.beta.messages.BetaTool;
14171410 import com.anthropic.models.beta.messages.MessageCreateParams;
14181411 // ...
from line 1440
14471440 .addUserMessage("What's on my calendar tomorrow?")
14481441 // Make the calendar server's tools available from this point onward.
14491442 // The block names the server; it never holds a URL or token.
1450 .addSystemMessageOfBetaContentBlockParams(List.of(
1451 BetaContentBlockParam.ofToolAddition(BetaRequestToolAdditionBlock.builder()
1443 .addSystemMessageOfBlocks(List.of(
1444 SystemMessageContentBlock.ofToolAddition(BetaRequestToolAdditionBlock.builder()
14521445 .definitionTool(BetaMcpToolset.builder()
14531446 .mcpServerName("calendar")
14541447 .build())
from line 1780
17871780 System = "You are a code review assistant. Be concise.",
17881781 Messages =
17891782 [
1790 new()
1783 new UserMessageParam { Content = "Review process() in utils.py for performance issues." },
1784 new AssistantMessageParam
17911785 {
1792 Role = Role.User,
1793 Content = "Review process() in utils.py for performance issues."
1794 },
1795 new()
1796 {
1797 Role = Role.Assistant,
17981786 Content = "The list comprehension is fine for small inputs. For large inputs, consider a generator to avoid materializing the full list."
17991787 },
1800 new()
1801 {
1802 Role = Role.User,
1803 Content = "Now review the calling code that invokes process()."
1804 },
1788 new UserMessageParam { Content = "Now review the calling code that invokes process()." },
18051789 // The reviewer realizes mid-session that all suggestions must also pass
18061790 // the team's strict typing policy. Appending the instruction here keeps
18071791 // earlier turns byte-identical, so the prefix cached by the previous
18081792 // request is still read from cache.
1809 new()
1793 new SystemMessageParam
18101794 {
1811 Role = Role.System,
18121795 Content = "From now on, every suggestion must include explicit type annotations."
18131796 }
18141797 ]
from line 1842
18591842 ```java Java
18601843 import com.anthropic.models.messages.CacheControlEphemeral;
18611844 // ...
1862 import com.anthropic.models.messages.MessageParam;
1863 // ...
18641845 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
18651846 
18661847 MessageCreateParams params = MessageCreateParams.builder()
from line 1858
18771858 // the team's strict typing policy. Appending the instruction here keeps
18781859 // earlier turns byte-identical, so the prefix cached by the previous
18791860 // request is still read from cache.
1880 .addMessage(MessageParam.builder()
1881 .role(MessageParam.Role.SYSTEM)
1882 .content("From now on, every suggestion must include explicit type annotations.")
1883 .build())
1861 .addSystemMessage("From now on, every suggestion must include explicit type annotations.")
18841862 .build();
18851863 
18861864 Message response = client.messages().create(params);
from line 2194
22162194 MaxTokens = 4096,
22172195 Messages =
22182196 [
2219 new() { Role = Role.User, Content = "Draft a short status update on the database migration for the team channel." },
2197 new BetaUserMessageParam { Content = "Draft a short status update on the database migration for the team channel." },
22202198 // Turn-scoped reminder: renders for this turn, then clears once a later user message exists.
2221 new()
2199 new BetaSystemMessageParam
22222200 {
2223 Role = Role.System,
22242201 ClearAt = ClearAt.NextUserMessage,
22252202 Content = "The reader is on call: keep this reply under 50 words.",
22262203 },
from line 2245
22682245 ```java Java
22692246 import com.anthropic.models.beta.AnthropicBeta;
22702247 import com.anthropic.models.beta.messages.BetaMessage;
2271 import com.anthropic.models.beta.messages.BetaMessageParam;
2248 import com.anthropic.models.beta.messages.BetaSystemMessageParam;
22722249 import com.anthropic.models.beta.messages.MessageCreateParams;
22732250 import com.anthropic.models.messages.Model;
22742251 
from line 2258
22812258 .addBeta(AnthropicBeta.MID_CONVERSATION_SYSTEM_CLEAR_AT_2026_08_21)
22822259 .addUserMessage("Draft a short status update on the database migration for the team channel.")
22832260 // Turn-scoped reminder: renders for this turn, then clears once a later user message exists.
2284 .addMessage(BetaMessageParam.builder()
2285 .role(BetaMessageParam.Role.SYSTEM)
2286 .clearAt(BetaMessageParam.ClearAt.NEXT_USER_MESSAGE)
2261 .addMessage(BetaSystemMessageParam.builder()
2262 .clearAt(BetaSystemMessageParam.ClearAt.NEXT_USER_MESSAGE)
22872263 .content("The reader is on call: keep this reply under 50 words.")
22882264 .build())
22892265 .build();
Feedback