If you're using Claude or another AI assistant for PHP development without a CLAUDE.md , you've seen this pattern: the AI generates working code, but it's PHP 5-era style — no type hints, mysql_* functions, procedural globals, or die() error handling. PHP has evolved dramatically. PHP 8.x has union types, enums, fibers, named arguments, match expressions, and readonly properties. Modern PHP is a different language from what most AI training data contains. Without explicit rules, AI defaults to the lowest common denominator. A CLAUDE.md file at your repo root tells the AI which decade you're working in. Here are the 13 rules that have the highest impact. Rule 1: Enforce strict types on every file Every PHP file must start with `declare(strict_types=1);` immediately after the opening tag. No exceptions — including scripts, controllers, helpers, and test files. Enter fullscreen mode Exit fullscreen mode Without strict_types , PHP silently coerces values. A function expecting int accepts "42" without warning.…