CLAUDE.md for TypeScript and Node.js: 13 Rules That Make AI Write Type-Safe, Production-Ready Code TypeScript exists to catch bugs the compiler can prove. Node.js exists to ship them to production fast. When you let an AI assistant write either, the default output drifts toward any , untyped Express handlers, and validation skipped at the boundary "for now." It compiles. It runs. It explodes when a string shows up where a number was expected. A CLAUDE.md at the repo root fixes this. It's the file Claude Code reads on every session — the contract that says: this codebase does not accept loose types, throw strings, or trust req.body . Below are 13 rules I've shipped in production TypeScript repos that make AI-generated code merge-ready instead of review-ready. 1. Strict TypeScript config is non-negotiable Problem: AI defaults to permissive tsconfig.json and silently leans on implicit any .…