new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

explore / Web & frontend / mozg

Zod

Answer questions about Zod 4 as documented today: defining schemas for every type, refinements and transforms, parsing versus safe parsing, error handling and customising messages, type inference, JSON Schema output, the mini build, ecosystem integrations, and exactly what changed from Zod 3 and how to migrate it.

359 notes · updated 2026-08-13 · trained 83%

since last sitting: +26 newly passed — this brain is learning · the verified changelog →

use this brain
# sign in to get a token
$ claude mcp add --transport http mozg \
https://mozg.sh/mcp --header "Authorization: Bearer …"
> use mozg/zod — …
Sign in — get this command with your token in it

New here? Sign in and this exact command appears with your token already inside — copy, paste into your terminal, done.

Or just add it

Sign in and add it, and every agent you have connected can read it — nothing to download, and it stays current as the author updates it.

Sign in to add it

Ask it things like

answers 26/30 on its latest exam
You want to customize an error message specifically for a required field validation. How do you replace the old invalid_type_error and required_error parameters in Zod 4?Error Handling
How do you convert a Zod schema to JSON Schema format?JSON Schema
What is the key difference between .parse() and .safeParse() in terms of their return values?Parsing Modes
How do you extract the TypeScript output type from a Zod schema?Type Inference
How does z.codec() work, and what makes it different from z.transform()?Codecs & Bidirectional
What option prevents infinite loops when generating JSON Schema for recursive schemas?JSON Schema
How do you convert existing JSON Schema back into a Zod schema?JSON Schema
How does Zod Mini's API differ from standard Zod methods?Mini Build

What it can answer

30 coverage checks
83%
Answers 26 of the exam's 30 questionsIt answers 26 questions, 26 more than last time, out of an exam that grew by 30.Nothing it used to answer has stopped working.
Error Handling4 / 4
JSON Schema3 / 3
Mini Build3 / 3
Refinements & Transforms3 / 4
Schema Definitions3 / 4
Type Inference3 / 3
Codecs & Bidirectional2 / 2
Parsing Modes2 / 3
Zod 4 Migration2 / 3
Performance1 / 1
exam badge — share this score →

Attacks survived

re-run weekly · 2026-08-09
gate-battery12/12 known hostile payloads caught by the ingest gate
injection-corpusevery active note scanned — no steering language
secret-corpusevery active note scanned — no keys or credentials

heuristic scans against known attack classes — measured and dated, not a promise of unpoisonability

Inside

  • Zod Mini API uses functional tree-shakable functions instead of methods · mini build
  • z.registry() creates typed metadata registry · advanced schema types
  • Zod 4 reduces tsc instantiations by 100x · performance & size
  • Zod 4 core bundle size 2.3x smaller · performance & size
  • Zod Mini .check() method for refinements · mini build
  • Zod Mini core bundle size 6.6x smaller than Zod 3 · mini build
  • Zod 4 benchmarks: string parsing 14.71x faster · performance & size
  • Zod 4 benchmarks: object parsing 6.5x faster · performance & size
  • Zod 4 installation command · zod 4 migration
  • Zod 4 fixes compiler issues with chaining extend() and omit() · performance & size
  • Zod 4 benchmarks: array parsing 7.43x faster · performance & size
  • Zod Mini has identical parsing methods · mini build
  • Zod Mini available refinements and checks · mini build
  • z.globalRegistry accepts JSON Schema metadata · advanced schema types

Licence

CC BY-NC-SA 4.0

Use it, copy it, build on it, with credit. Selling it is not allowed.