<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: ProAndMax</title>
    <description>The latest articles on Forem by ProAndMax (@proandmax).</description>
    <link>https://forem.com/proandmax</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3789999%2F7523954d-5541-48eb-abb8-13d4ea24c128.png</url>
      <title>Forem: ProAndMax</title>
      <link>https://forem.com/proandmax</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/proandmax"/>
    <language>en</language>
    <item>
      <title>Fixing the Claude 4.6 prefilling removal with one import change</title>
      <dc:creator>ProAndMax</dc:creator>
      <pubDate>Tue, 24 Feb 2026 17:16:28 +0000</pubDate>
      <link>https://forem.com/proandmax/fixing-the-claude-46-prefilling-removal-with-one-import-change-42o9</link>
      <guid>https://forem.com/proandmax/fixing-the-claude-46-prefilling-removal-with-one-import-change-42o9</guid>
      <description>&lt;p&gt;A couple weeks ago Anthropic shipped Claude 4.6 and removed support for assistant message prefilling. No deprecation period, just gone. If you were doing this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Extract the name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;assistant&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You now get a 400. Their migration guide says to use structured outputs or rewrite your prompts. If you have prefills scattered across a codebase, that's not a quick fix.&lt;/p&gt;

&lt;p&gt;I wrote &lt;code&gt;anthropic-compat&lt;/code&gt; to deal with it. It wraps the official SDK, catches the trailing assistant message, and converts it to a system prompt instruction telling the model to start its response with that exact text. The output is the same, model picks up right where the prefill left off.&lt;/p&gt;

&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# before
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&gt;

&lt;span class="c1"&gt;# after
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;anthropic_compat&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything else stays identical. Client, methods, exceptions, streaming, async, all passed through.&lt;/p&gt;

&lt;p&gt;It also handles the &lt;code&gt;output_format&lt;/code&gt; to &lt;code&gt;output_config.format&lt;/code&gt; parameter rename they shipped in the same release, which is one less thing to grep for.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install anthropic-compat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/ProAndMax/anthropic-compat" rel="noopener noreferrer"&gt;https://github.com/ProAndMax/anthropic-compat&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;32 tests, no monkey patching, MIT licensed. Not saying structured outputs aren't the right long-term move, but if you just need your stuff to stop breaking right now this might help.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>claude</category>
      <category>api</category>
    </item>
  </channel>
</rss>
