From 237ad9eccef60d8206dc1f9ce70f4df88d550916 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 16 Jan 2026 13:20:05 -0600 Subject: [PATCH] Add a `CLAUDE.md` (#17517) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I'm a bit annoyed to make it tool-specific, and that it's needed in the first place, but 🤷‍♀️ I think it'll make a difference so here we go. This has a few items inspired by https://github.com/astral-sh/ruff/blob/main/CLAUDE.md --- CLAUDE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..5f6d12068 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,11 @@ +- Read CONTRIBUTING.md for guidelines on how to run tools +- ALWAYS attempt to add a test case for changed behavior +- PREFER integration tests, e.g., at `it/...` over unit tests +- When making changes for Windows from Unix, use `cargo xwin clippy` to check compilation +- NEVER perform builds with the release profile, unless asked or reproducing performance issues +- PREFER running specific tests over running the entire test suite +- AVOID using `panic!`, `unreachable!`, `.unwrap()`, unsafe code, and clippy rule ignores +- PREFER patterns like `if let` to handle fallibility +- ALWAYS write `SAFETY` comments following our usual style when writing `unsafe` code +- PREFER `#[expect()]` over `[allow()]` if clippy must be disabled +- PREFER let chains (`if let` combined with `&&`) over nested `if let` statements