What Claude Sonnet 5 gets wrong about zod — battery v1, tested 2026-08-29

Run zod--claude-sonnet-5--v1--2026-08-29

Superseded. A later run of the same subject exists: zod--claude-sonnet-5--v2--2026-08-29. This page is kept as the longitudinal record and is never deleted.

Summary

Half-migrated. Reached the v4 top-level format functions but paired them with the v3 error param, could not resolve whether v4 is the default install, and hedged by emitting a live Zod 3 fallback block. Half-migrated beliefs are their own failure mode and are invisible to anyone checking only "does it know v4?"

SubjectClaude Sonnet 5 claude-sonnet-5, Anthropic
Invoked asAgent tool, model alias "sonnet"
Cutoff the model statesnot stated
Newest zod release it could place4.0.x · 2025-07-10
Oldest zod release it could not place4.1.0 · 2025-08-23 (so this run brackets the subject’s boundary to 2025-07-10 – 2025-08-23)
In its own wordsZod 4, 'GA sometime in 2025' — no minor/patch knowledge; low stated confidence
Library at test timezod 4.5.2 (npm), verified 2026-08-29
Batteryzod/v1 · 6 tasks, 3 direct questions
Tool uses during test0 (a run with any tool use is void — we measure training knowledge, not retrieval)
Tested2026-08-29
Findings3, of which 3 chargeable

Findings

F1 · v4 format function paired with the v3 error param

S3deprecated · message param · deprecated · changed in zod 4.0.0 (2025-07-10) · chargeable

What the model believes

Wrote z.email({ message: "Please enter a valid email address" }) — the v4 top-level function with the v3 error key.

What it wrote
z.email({ message: "Please enter a valid email address" })
What works on zod 4.5.2
z.email({ error: "Please enter a valid email address" })
Impact

A hybrid that no version's docs teach: message is deprecated in v4, and invalid_type_error / required_error were dropped entirely.

Scope note

Notable failure shape rather than a costly one: the code runs, the custom message is what is at risk.

Verified against

F2 · unresolved v3/v4 default, so it emits a Zod 3 fallback block

S4wrong-metadata · import path · version-fact · changed in zod 4.0.0 (2025-07-10) · chargeable

What the model believes

"I'm not fully certain of the exact current state of that import-path split, so I'd treat this as the part most worth double-checking." It then hedged by emitting a commented Zod 3 alternative alongside its answer: z.string().uuid(), z.string().email(), z.string().url(), result.error.flatten().

What it wrote
// Zod 3 alternative
z.string().uuid()
z.string().email()
z.string().url()
result.error.flatten()
What works on zod 4.5.2
z.uuid()
z.email()
z.url()
z.treeifyError(result.error)
Impact

The v3 block is dead, wrong-for-current code shipped as live output. This test gave the model room to hedge; an ordinary coding request ("add a Zod schema here") gives it none, and the v3 branch is what lands.

Verified against

F3 · version recency

S4wrong-metadata · version-fact · changed in zod 4.1.0 (2025-08-23) · chargeable

Anchored to the first release the model could not describe, not to the current release: that is the point at which its version belief became wrong, and it is inside the stated cutoff. The current version at test date is in library.latest_version_at_test.

What the model believes

"Zod 4 is the latest major, GA sometime in 2025", with explicitly low confidence, no knowledge of the minor line, and self-rated "moderate rather than high" confidence that v4 was even stable-by-default yet.

Impact

Cannot advise on upgrades. Mitigated by honest, unprompted low-confidence marking.

Verified against

What it got right, and near misses

Recorded so the run cannot be read as a hit list. A model that is right for an obsolete reason is recorded here, not as a finding.

KindAPINote
correct Top-level z.uuid() / z.email() / z.url() as the primary answer, two-argument z.record(z.string(), z.number()) with the v3 single-arg form correctly called out as removed, z.flattenError(), z.infer, .partial(), .pick({...}), z.coerce.number(), import { z } from "zod". Zod 3 dated to ~2021 correctly.

Open questions from this run

Sources

Battery specification: prompts/zod.md in the studio repo. Every finding above also carries its own citation.