---
library: zod
library-latest: "4.5"
library-latest-verified: 2026-08-28
library-latest-note: "minor line only — the founding session did not record a patch; 4.5.2 confirmed 2026-08-29"
model: claude-haiku-4-5-20251001
model-believed-latest: "3 (claims v3 released Sept 2024 — also false; v3 shipped 2021)"
test-date: 2026-08-28
battery: zod/v1 (6 idiomatic tasks + 3 direct questions)
verified-against: https://zod.dev/v4/changelog
status: open (no retest yet)
json: haiku-4-5.json
---

# Zod × Claude Haiku 4.5 — findings

## F1 · S1 breaks-build · single-argument z.record()
Model wrote: `z.record(z.number())` for string→number records.
Truth: Zod 4 requires both key and value schemas — `z.record(z.string(), z.number())`;
the single-argument form was **removed**. Generated code fails type-checking on zod@4.
Cite: https://zod.dev/v4/changelog (Record Schema Changes).

## F2 · S3 deprecated · method-style string format validators
Model wrote: `z.string().uuid()`, `z.string().email(...)`, `z.string().url()` and asserted
".email() method is the current recommended way to validate email."
Truth: Zod 4 moved format validators to top-level (`z.uuid()`, `z.email()`, `z.url()`);
method forms are deprecated. The "recommended way" claim is false for current Zod.
Cite: https://zod.dev/v4/changelog (String Format Validators).

## F3 · S3 deprecated · `message`-style custom errors
Model wrote: `z.string().email('Please enter a valid email')` / `{ message: ... }`.
Truth: Zod 4 unifies customization under the `error` param (`z.email({ error: ... })`);
`message`, `invalid_type_error`, `required_error` are deprecated.
Cite: https://zod.dev/v4/changelog (Error Customization).

## F4 · S3 deprecated · `.flatten()` for form errors
Model wrote: `result.error.flatten()` → `fieldErrors`/`formErrors` for form UIs.
Truth: `.flatten()` and `.format()` are deprecated in Zod 4; use top-level
`z.treeifyError(result.error)`.
Cite: https://zod.dev/v4/changelog (Error Formatting).

## F5 · S4 wrong-metadata · version belief
Model asserted Zod 3 is the latest major, "released September 2024," and described a fictional
v2→v3 changelog. Actual latest at test date: Zod 4.5 (v4 line shipped 2025). A user asking this
model "should I upgrade?" gets confidently wrong advice.

## Correct under current Zod (unaffected)
`safeParse` discrimination, `z.infer`, `.partial()`, `.pick({...})`, `z.coerce.number()` basic
usage, import path `import { z } from 'zod'`. (Note: v4 coercion accepts `unknown` input and
changed missing-key behavior with coerced fields — battery v2 should probe this.)
