Cargo Worktree Hygiene

•
6
•

Manages compilation concurrency, target isolation, and disk headroom across parallel Rust git worktrees.

Cargo Worktree Hygiene prevents CPU thrashing and disk exhaustion when running parallel Rust builds across multiple git worktrees. Tailored for autonomous agent fleets and multi-branch developer workflows, it enforces isolated target directories to avoid stale artifacts and lock serialization, throttles core allocations using dynamic CARGO_BUILD_JOBS budgeting, and implements pre-flight disk guards with automated cargo sweep cleanup. It is ideal for teams operating concurrent AI builders, CI runners, or developers working in storage-constrained environments.

Key Features

01Per-worktree target directory isolation to eliminate stale artifacts and build locks
02Seamless integration with content-hashed dependency caching like sccache
03Pre-flight disk safety guard to prevent filesystem starvation and write failures
04Automated post-PR worktree teardown and target artifact purging
056 GitHub stars
06Dynamic CPU concurrency throttling based on available cores and active builders

Use Cases

01Running multiple autonomous AI coding agents concurrently on a Rust codebase
02Building and testing Rust projects in storage-constrained CI/CD or virtual environments
03Diagnosing and resolving CPU thrashing or stale test failures in multi-worktree setups