Java developers have a particular problem with AI assistants: the models have seen fifteen years of StackOverflow answers, legacy tutorials, and pre-Java-11 patterns. Without guidance, Claude will write new ArrayList<>() where you want List.of() , null checks where you want Optional , and raw Exception catches where you want specific error types. A well-written CLAUDE.md fixes this. Here are 13 rules that push AI-generated Java from Java 8-era code to modern, idiomatic production Java. 1. Use modern collection factory methods // Bad — verbose, mutable List < String > tags = new ArrayList <>(); tags . add ( "java" ); tags . add ( "api" ); Map < String , Integer > codes = new HashMap <>(); codes . put ( "OK" , 200 ); // Good — Java 9+, immutable by default List < String > tags = List . of ( "java" , "api" ); Map < String , Integer > codes = Map .…