What to put in an AGENTS.md for a Rust repo
Cargo makes the commands the same everywhere, so the useful lines are the flags: which features CI builds, whether warnings fail it, and the oldest Rust you support. In a workspace, say what each crate is.
Which commands should it list?
cargo build --workspaceevery member; a virtual workspace root does this by defaultcargo test -p <crate> <name>one crate, tests whose name contains<name>; doc tests run toocargo clippy --all-targets -- -D warningsfails on any warning, rustc's includedcargo fmt --all -- --checkexits non-zero if anything is unformatted; settings inrustfmt.tomlcargo test --all-featurestests and Clippy build default features only unless told otherwise
Write them as your repo runs them, with its package manager and flags, plus how to run one test.
What layout should it explain?
- The workspace members and what each crate is for; they share one
Cargo.lockandtarget/. rust-version(the MSRV) and anyrust-toolchain.toml, which pins the toolchain and its components.- Shared versions in
[workspace.dependencies], which members inherit withworkspace = true.
What do agents get wrong?
- Features must be additive: enabling one should never remove functionality.
- Code must build on
rust-version; Clippy'sincompatible_msrvlint flags newer APIs. - Name the feature sets CI tests (default,
--no-default-features,--all-features); a change can break one the agent never built.
From the official docs: doc.rust-lang.org/cargo-test.html (new tab) · doc.rust-lang.org/usage.html (new tab) · github.com/rustfmt (new tab) · doc.rust-lang.org/workspaces.html (new tab) · doc.rust-lang.org/features.html (new tab) · doc.rust-lang.org/rust-version.html (new tab) · rust-lang.github.io/overrides.html (new tab). The rest of the file is the same for any project: what goes in an AGENTS.md.
Rust repos with an AGENTS.md or CLAUDE.md (24)
24 of the 45 Rust repos on the leaderboard have an AGENTS.md or CLAUDE.md at the root, and 23 are long enough to pass the AGENTS.md check in full. Most-starred first; each file name links to the file.
| Repo | File | Length |
|---|---|---|
| rustdesk/rustdesk | AGENTS.md | 18,208 chars |
| rust-lang/rust | AGENTS.md | 13,839 chars |
| denoland/deno | CLAUDE.md | 11,861 chars |
| oven-sh/bun | AGENTS.md | 17,516 chars |
| zed-industries/zed | AGENTS.md | 12,454 chars |
| astral-sh/uv | AGENTS.md | 3,745 chars |
| warpdotdev/warp | AGENTS.md | 19,737 chars |
| meilisearch/meilisearch | AGENTS.md | 989 chars |
| aaif-goose/goose | AGENTS.md | 6,078 chars |
| astral-sh/ruff | AGENTS.md | 20,201 chars |
| nushell/nushell | AGENTS.md | 2,364 chars |
| pnpm/pnpm | AGENTS.md | 33,872 chars |
| qdrant/qdrant | CLAUDE.md | 5,588 chars |
| h4ckf0r0day/obscura | AGENTS.md | 10,387 chars |
| surrealdb/surrealdb | CLAUDE.md | 6,080 chars |
| nautechsystems/nautilus_trader | AGENTS.md | 5,349 chars |
| vercel/turborepo | AGENTS.md | 2,364 chars |
| chroma-core/chroma | AGENTS.md | 128 chars |
| biomejs/biome | AGENTS.md | 5,171 chars |
| oxc-project/oxc | AGENTS.md | 15,226 chars |
| risingwavelabs/risingwave | AGENTS.md | 7,610 chars |
| GreptimeTeam/greptimedb | AGENTS.md | 8,382 chars |
| MaterializeInc/materialize | AGENTS.md | 8,331 chars |
| krakenfx/kraken-cli | AGENTS.md | 39,417 chars |
More examples
- Every language: all 226 files, with the longest and shortest that pass
- Most agent-friendly Rust repos: all 45, ranked on every check
- AGENTS.md vs CLAUDE.md: which file to write
- TypeScript (64)
- Python (29)
- Go (23)
- Java (19)
- C++ (11)
- JavaScript (9)
- Kotlin (8)
- PHP (7)
- Ruby (6)