Cargo-Atlas Builds Compiler-Accurate Rust Maps for AI Coding Assistants
Summary
Cargo-atlas is a prototype command-line tool that builds a compiler-accurate map of a Rust workspace for AI coding assistants such as Claude Code. It answers questions including which code calls a function, what a function calls, and which types implement a trait, returning file and line locations instead of relying on function-name matches. In a test fixture, it resolved all seven calls to the exact function, while the name-matching tool Graphify resolved none. A separate check of 50 random call links found all 50 correct, and 150 call sites selected from the source text included every call into a workspace function. In a larger comparison, cargo-atlas found 5,948 function-to-function links versus Graphify’s 2,809; 39% of Graphify’s comparable links targeted a different function from the one resolved by rust-analyzer. The tool requires rust-analyzer and the Rust standard-library source, because macro expansion and standard-type inference depend on them, and it can build an index, inspect callers and callees, find trait implementations, explain symbols, and generate a report. Its graph combines rust-analyzer SCIP definitions and references, Cargo metadata, and syntax parsed with syn. Links are labeled EXACT, CANDIDATE, or SYNTAX to distinguish verified resolutions, possible dynamic-dispatch targets, and un-type-checked source findings. The project documents limits including blanket implementations, shared symbols, failed proc-macro builds, default Cargo features only, and reliance on the unstable rust-analyzer SCIP interface. An MCP server and Claude Code skills are planned, while a crates.io release is not yet available.