Build once. Reuse the work.
open sourceApache-2.0self-hostablefree
Kache is a compiler cache for Rust, C/C++ and CUDA that restores matching compiler outputs across git worktrees and CI runs. Outputs are stored once in a content-addressed cache with a disk budget, and on filesystems with copy-on-write cloning (APFS, btrfs) restored files share disk blocks with the cache instead of being copied. A background daemon dedupes identical in-flight compiles and paces compiler processes, and caches can be shared through S3-compatible storage, GCS, a shared filesystem or an OCI registry. kache explain and kache monitor show why a build missed the cache.
Problems it solves
- every extra worktree of the same repo costs another 16 GB of build output
- building the same revision in two worktrees rebuilds all the crates twice
- the same compiled bytes are stored again in every checkout's target directory
- running three cargo builds at once makes my laptop grind to a halt
- CI rebuilds every dependency on every run even though nothing changed
- I want to know why my build missed the cache and recompiled a crate
- parallel coding agents each building their own copy of the project fill my SSD
- cache C++ and CUDA object compilation without changing my Makefile
- keep build outputs under a fixed disk budget instead of cleaning by hand
- share Rust build artifacts between CI runners through an S3 bucket
- switching git branches back and forth makes cargo recompile crates it already built
Features
- reuse across worktrees with different paths
- APFS/btrfs copy-on-write restores
- disk budget for the store
- dedupe identical in-flight compiles
- compiler process pacing
- remote cache on S3, GCS, shared filesystem or OCI registry
- miss explanations (kache explain)
- live TUI monitor
- GitHub Action
- GCC, Clang, clang-cl and CUDA object caching
Capabilities
| Has a command line tool | plan not known |
|---|
Recommended by
- “Why not use kache?” LankyLingonberry2532, reddit, 2026-11-13 source
- “a new worktree's builds take 14 seconds and add 2 GB, on stable Cargo” Nathan Broadbent (DocSpring), blog, 2026-11-13 source
What people say
- Mr Boxington's README says kache directly inspired its design source
Alternatives
The same job
These do what Kache does.
- Mr Boxington (mbx) A shared cache for Cargo builds
- sccache Shared compilation cache for C, C++, Rust and CUDA, stored locally or in the cloud
- ccache Compiler cache that speeds up C and C++ rebuilds
- Swatinem/rust-cache A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.
- cargo-sweep A cargo subcommand for cleaning up unused build files generated by Cargo
