Zod 4 is a major breaking release with real performance wins and faster TypeScript compilation, but you'll need to update your code. The biggest gotchas are z.record() now requiring two arguments instead of one, strict objects moving from .strict() to z.strictObject(), and .default() behavior changing in ways that'll bite you if you're using transforms. This guide walks through the migration with a quick reference table, covers new features like z.file() and z.templateLiteral(), and includes find-replace patterns for the common breaks. If you're maintaining a Zod 3 codebase or starting fresh with v4, this gives you the specifics without having to dig through changelog noise.

skills.sh installs
289
GitHub stars
9
last updated
Aug 21, 2026

Install

$ npx -y skills add kastalien-research/thoughtbox-dot-claude --skill zod4 --agent claude-code

Installs into .claude/skills of the current project.

Files

Zod 4 Expert Guide

Zod 4 is a major release with significant performance improvements, reduced TypeScript compilation times, and a cleaner API. This skill covers migration from v3 and idiomatic Zod 4 usage.

Quick Migration Checklist

Before diving deep, address these high-impact breaking changes:

ChangeZod 3Zod 4
Record schemasz.record(z.string())z.record(z.string(), z.string())
Strict objects.strict()z.strictObject({...})
Passthrough.passthrough()z.looseObject({...})
Error formattingerr.format()z.treeifyError(err)
Coerce input typestringunknown

Install Zod 4:

npm install zod@^4.0.0

For detailed breaking changes, see ./reference/breaking-changes.md.


Key Breaking Changes

1. z.record() Requires Two Arguments

// Zod 3 (BROKEN in v4)
z.record(z.string());

// Zod 4 (REQUIRED)
z.record(z.string(), z.string());

2. Strict/Loose Object Syntax

// Zod 3
z.object({ name: z.string() }).strict();
z.object({ name: z.string() }).passthrough();

Sponsors

Details

Repository
github.com/kastalien-research/thoughtbox-dot-claude
Categories
Documentation, Data Science & ML
First seen
Jun 3, 2026

More from kastalien-research/thoughtbox-dot-claude

All 2
1postplusai avatarpattern-routerpostplusai/postplus-skillsRoute short-form video prompt work into the right hook or segment pattern before writing storyboards or provider requests. Use when the user has a brief, a segm289skills.sh installs
2kastalien-research avatareffect-tskastalien-research/thoughtbox-dot-claudeComprehensive guide for Effect-TS, the functional TypeScript library. Use when building Effect applications, especially MCP servers. Covers correct APIs, common288skills.sh installs
3vm0-ai avatarlarkvm0-ai/vm0-skillsLark API for collaboration. Use when user mentions "Lark", "Lark docs", or asks about ByteDance workspace tools.288skills.sh installs
4pproenca avatarruby-optimisepproenca/dot-skillsRuby performance optimization guidelines. This skill should be used when writing, reviewing, or refactoring Ruby code to ensure optimal performance patterns. Tr286skills.sh installs
5rstackjs avatarrspack-tracingrstackjs/agent-skillsComprehensive guide and toolkit for diagnosing Rspack build issues. Quickly identify where crashes/errors occur, or perform detailed performance profiling to re286skills.sh installs
6gohypergiant avataraccelint-react-testinggohypergiant/agent-skillsUse when writing, reviewing, or refactoring React component tests with Testing Library. Load when you see render(), screen, fireEvent, userEvent, waitFor, or *.282skills.sh installs