Cargo-reapi: A Shared Build Cache for Parallel Rust Agent Pipelines
cargo-reapi adds a shared build cache to Cargo for parallel Rust agent pipelines, cutting redundant compiles across worktrees without replacing Cargo's build graph.
cargo-reapi is a new caching layer for Cargo that lets multiple worktrees and processes reuse compiled artifacts without replacing Cargo's own build graph. It hooks into Cargo via RUSTC_WRAPPER to observe every scheduled compiler and linker action, verifies inputs and outputs, and either restores cached results or coalesces identical concurrent work.
The tool targets a specific pain point in agentic coding workflows, where many independent AI agents spin up separate clean checkouts of the same repository and redundantly repeat expensive compilation. In dogfooding tests against Moria, a Rust/Bevy voxel-world project, five simultaneous clean builds completed full quality gates in under 25 seconds with zero physical compiler or linker work, coalescing identical actions into a single physical build.
Unlike Bazel's rules_rust or Buck2/Reindeer, which require maintaining a second, parallel build graph alongside Cargo, cargo-reapi keeps Cargo as the sole planner and works around it non-invasively. The project has passed qualification suites on macOS/APFS and Linux/XFS, though it still lacks a human-readable CLI summary, Windows support, and validation against a live Remote Execution API service.