14 CLAUDE.md Rules That Make AI Write Truly Safe Rust Code Rust's compiler catches more bugs than any other mainstream language — and AI assistants still find creative ways to ship broken code in it. unwrap() on user input. std::sync::Mutex guards held across .await . Box<dyn Error> smeared across every public signature. Mocked databases in tests that pass while broken queries ship to prod. A CLAUDE.md file in the repo root fixes this. Claude Code reads it on every task. Cursor, Continue, Aider, and most other AI coding tools respect it too. The rules below are what I drop into Rust 2021 / 2024-edition projects to stop the AI from re-introducing the same anti-patterns I keep deleting in code review. Full file as a Gist: https://gist.github.com/oliviacraft/2be60f21ea4ffcdd24cdcf0846ef66ba 1.…