Newer Claude Models Show Tool-Calling Regression

simonwillison.net · ⭐️ 8/10 · 2026-07-04

Newer Claude models (Opus 4.8 and Sonnet 5) generate malformed tool calls that include extra invented fields, causing tool call rejections in third-party coding harnesses like Pi, while older models did not exhibit this issue. This counterintuitive regression shows that reinforcement learning for specific tool schemas can degrade performance on other tools, posing reliability challenges for developers building agents that rely on consistent tool-use behavior. The malformed calls typically have the correct edit content but include made-up keys in the nested edits[] array, violating the schema. Armin Ronacher hypothesizes that newer models are overtrained on Claude Code's built-in edit tool format.

Background

Large language models use tool-calling (function calling) to interact with external APIs by generating structured JSON arguments according to a predefined schema. Models can be fine-tuned or reinforced to improve accuracy on specific tools, which can inadvertently bias them toward those tools' schemas at the expense of others. Coding harnesses like Pi define custom tools for editing files, and rely on the model to conform precisely to those schemas.

References

Read original