This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
The project uses pnpm workspaces. Key commands:
pnpm build- Build all packages (runs recursive build command)pnpm vitest run- Run all tests with Vitestpnpm vitest run <path>- Run specific test file (e.g.,packages/zod/src/v4/classic/tests/string.test.ts)pnpm vitest run <path> -t "<pattern>"- Run specific test(s) within a file (e.g.,-t "MAC")pnpm vitest run --update- Update all test snapshotspnpm vitest run <path> --update- Update snapshots for specific test filepnpm test:watch- Run tests in watch modepnpm vitest run --coverage- Run tests with coverage reportpnpm dev- Execute code with tsx under source conditionspnpm dev <file>- Execute<file>with tsx & proper resolution conditions. Usually use forplay.ts.pnpm dev:play- Quick alias to run play.ts for experimentationpnpm lint- Run biome linter with auto-fixpnpm format- Format code with biomepnpm fix- Run both format and lint
- Node.js v24+ required (use nvm if needed); pnpm v10.12.1
- ES modules are used throughout (
"type": "module") - All tests must be written in TypeScript - never use JavaScript
- Use
play.tsfor quick experimentation; use proper tests for all permanent test cases - Features without tests are incomplete - every new feature or bug fix needs test coverage
- Don't skip tests due to type issues - fix the types instead
- Test both success and failure cases with edge cases
- No log statements (
console.log,debugger) in tests or production code - Ask before generating new files
- Use
util.defineLazy()for computed properties to avoid circular dependencies - Performance is critical - parameter reassignment is allowed for optimization
- ALWAYS use the
ghCLI to fetch GitHub information (issues, PRs, etc.) instead of relying on web search or assumptions