<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/better-models-worse-tools-v197mvp7e" -->

---
title: Better Models: Worse Tools | daily.dev
description: Armin Ronacher investigates a regression in newer Claude models (Opus 4.8, Sonnet 5) where they emit extra, invented keys in tool call arguments that don't...
canonical: https://daily.dev/posts/better-models-worse-tools-v197mvp7e
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Better Models: Worse Tools | daily.dev
og:description: Armin Ronacher investigates a regression in newer Claude models (Opus 4.8, Sonnet 5) where they emit extra, invented keys in tool call arguments that don't...
og:url: https://daily.dev/posts/better-models-worse-tools-v197mvp7e
og:image: https://api.daily.dev/og/posts/v197mvP7E.png
og:image:alt: Better Models: Worse Tools
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Better Models: Worse Tools

**[Armin Ronacher](https://daily.dev/sources/mitsuhiko)** · 11 min read · 7 upvotes · 2 comments

## Summary

Armin Ronacher investigates a regression in newer Claude models (Opus 4.8, Sonnet 5) where they emit extra, invented keys in tool call arguments that don't match the schema, causing Pi's edit tool to reject calls. The failure is context-dependent, appearing mainly in long agentic sessions. The hypothesis is that post-training on Claude Code's forgiving harness — which silently filters unknown keys and applies parameter aliases — has reduced the gradient against schema violations, making newer models worse at adhering to non-Claude-Code tool schemas. Enabling Anthropic's strict mode eliminates the issue, suggesting server-side grammar-constrained sampling is the fix. The broader concern is that as post-training becomes increasingly tied to one closed-source harness, alternative tool schemas may become implicitly off-distribution, forcing third-party harnesses to either mimic Claude Code's quirks or rely on strict mode.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://lucumr.pocoo.org/2026/7/4/better-models-worse-tools>

## Questions this post answers

### Why does Claude Opus 4.8 add invented extra fields when calling tools with nested array parameters like edits[]?

Opus 4.8 and Sonnet 5 sometimes append made-up keys such as requireUnique, matchCase, or oldText2 after correctly generating oldText and newText inside a nested edits array. This appears to be a training artifact from reinforcement learning inside Claude Code's harness, which uses a flatter tool schema and silently tolerates or repairs malformed calls, biasing the model away from alternative nested-array schemas. Enabling Anthropic's strict tool mode eliminates the behavior.

_Teams debugging flaky agent tool calls can follow real-world findings like this on daily.dev._

### Does enabling strict mode in the Anthropic API fix malformed tool call arguments with extra invented keys?

Yes, turning on strict tool invocation eliminated the extra-key regression in testing on Claude Opus 4.8. Strict mode appears to make the server refuse to sample keys not permitted by the JSON schema, though Anthropic imposes complexity limits on tool definitions when strict mode is enabled, which is likely why Claude Code itself does not use it.

_daily.dev surfaces practical fixes like this for anyone hardening Claude-based coding agents._

### Did OpenAI's Codex models show the same malformed tool-call regression seen in Claude Opus 4.8?

No, Codex models tested did not reproduce the regression, with the exception of version 5.6 which was not tested due to lack of access. OpenAI's gpt-oss models use the documented Harmony response format, which explicitly marks tool-call bodies as JSON via a constrain tag, giving inference stacks a clear signal to apply JSON-constrained sampling.

_Comparing model reliability across Claude and Codex is easier when developers track findings like this on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@idoshamun** · 1 upvotes

> Funny how agents make agents training worse 😂

**@kartiknvj** · 0 upvotes

> This is one of the cleaner writeups of a structured-output regression I've read: the model invents keys that only a forgiving harness would silently drop, so the failure hides until a strict schema consumer rejects the call. The long-agentic-session detail matters too, since it means you can't catch it with single-turn schema tests, you need eval on multi-step traces. Has enabling strict mode or grammar-constrained sampling cost you anything on latency or valid-call rate, or is it basically free correctness?

## Similar posts on daily.dev

- [Quality Regression Analysis](https://daily.dev/posts/quality-regression-analysis-4zgnqihve) · SitePoint · 0 upvotes · 0 comments
- [Coding Models Are Doing Too Much](https://daily.dev/posts/coding-models-are-doing-too-much-ribjn9dws) · Hacker News · 2 upvotes · 1 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#claude](https://daily.dev/tags/claude), [#reinforcement-learning](https://daily.dev/tags/reinforcement-learning)

[View this post on daily.dev](https://daily.dev/posts/better-models-worse-tools-v197mvp7e)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Better Models: Worse Tools","url":"https://daily.dev/posts/better-models-worse-tools-v197mvp7e","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/better-models-worse-tools-v197mvp7e"},"datePublished":"2026-07-04T19:33:25.265Z","dateModified":"2026-09-13T21:16:20.686Z","description":"Armin Ronacher investigates a regression in newer Claude models (Opus 4.8, Sonnet 5) where they emit extra, invented keys in tool call arguments that don't...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1e6838282c72d284357f8572b037ad70?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1e6838282c72d284357f8572b037ad70?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Armin Ronacher","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Armin Ronacher","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/a7ee3aca0fbd455ea7510f79c0dd61fe","url":"https://daily.dev/sources/mitsuhiko"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/better-models-worse-tools-v197mvp7e","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"ai-agents,claude,reinforcement-learning","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Armin Ronacher","item":"https://daily.dev/sources/mitsuhiko"},{"@type":"ListItem","position":3,"name":"Better Models: Worse Tools"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/better-models-worse-tools-v197mvp7e","comment":[{"@type":"Comment","text":"Funny how agents make agents training worse 😂","datePublished":"2026-07-05T09:13:35.582Z","url":"https://daily.dev/posts/v197mvP7E#c-NcshUwlUn","author":{"@type":"Person","name":"Ido Shamun","url":"https://daily.dev/idoshamun","image":"https://media.daily.dev/image/upload/s---xy_OAwk--/f_auto,q_auto/v1703781380/avatars/avatar_28849d86070e4c099c877ab6837c61f0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"This is one of the cleaner writeups of a structured-output regression I’ve read: the model invents keys that only a forgiving harness would silently drop, so the failure hides until a strict schema consumer rejects the call. The long-agentic-session detail matters too, since it means you can’t catch it with single-turn schema tests, you need eval on multi-step traces. Has enabling strict mode or grammar-constrained sampling cost you anything on latency or valid-call rate, or is it basically free correctness?","datePublished":"2026-07-06T17:11:05.102Z","url":"https://daily.dev/posts/v197mvP7E#c-SM5ATYofK","author":{"@type":"Person","name":"kartik-nvjk","url":"https://daily.dev/kartiknvj","image":"https://media.daily.dev/image/upload/s--3gGgsVCw--/f_auto/v1781456774/avatars/avatar_TvTVeiMdkRCqWUDullFmy?_a=BAMAMiWQ0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/better-models-worse-tools-v197mvp7e#faq","mainEntity":[{"@type":"Question","name":"Why does Claude Opus 4.8 add invented extra fields when calling tools with nested array parameters like edits[]?","acceptedAnswer":{"@type":"Answer","text":"Opus 4.8 and Sonnet 5 sometimes append made-up keys such as requireUnique, matchCase, or oldText2 after correctly generating oldText and newText inside a nested edits array. This appears to be a training artifact from reinforcement learning inside Claude Code's harness, which uses a flatter tool schema and silently tolerates or repairs malformed calls, biasing the model away from alternative nested-array schemas. Enabling Anthropic's strict tool mode eliminates the behavior. Teams debugging flaky agent tool calls can follow real-world findings like this on daily.dev."}},{"@type":"Question","name":"Does enabling strict mode in the Anthropic API fix malformed tool call arguments with extra invented keys?","acceptedAnswer":{"@type":"Answer","text":"Yes, turning on strict tool invocation eliminated the extra-key regression in testing on Claude Opus 4.8. Strict mode appears to make the server refuse to sample keys not permitted by the JSON schema, though Anthropic imposes complexity limits on tool definitions when strict mode is enabled, which is likely why Claude Code itself does not use it. daily.dev surfaces practical fixes like this for anyone hardening Claude-based coding agents."}},{"@type":"Question","name":"Did OpenAI's Codex models show the same malformed tool-call regression seen in Claude Opus 4.8?","acceptedAnswer":{"@type":"Answer","text":"No, Codex models tested did not reproduce the regression, with the exception of version 5.6 which was not tested due to lack of access. OpenAI's gpt-oss models use the documented Harmony response format, which explicitly marks tool-call bodies as JSON via a constrain tag, giving inference stacks a clear signal to apply JSON-constrained sampling. Comparing model reliability across Claude and Codex is easier when developers track findings like this on daily.dev."}}]}
```

