Introduction
kache is a drop-in RUSTC_WRAPPER for Rust and a cc / c++ compiler wrapper for C/C++ object compiles. Cache keys are blake3 hashes of normalized compiler inputs; cache hits restore zero-copy (reflink, with a hardlink/copy fallback on filesystems without CoW), and identical blobs are stored once and shared. Optional S3 sync (AWS, Ceph, MinIO, R2) shares Rust artifacts across machines.
Local Rust caching, local C/C++ object caching, and direct S3 sync are working today. C/C++ artifacts are local-only for now; unsupported compiler shapes pass through to the real compiler.
PREVIEW: a remote planner that prefetches from workspace manifests, dependency history, and build intent — warming the right artifacts before rustc asks for them. The daemon already calls a planner when KACHE_PLANNER_ENDPOINT is set; the hosted service is still preview. See Remote service.

Cold compile populates kache's store,
cargo cleanwipestarget/, and the second build pulls every artifact back zero-copy (reflink, falling back to hardlink/copy).
Why local kache is fast
kache is useful even before remote cache is configured:
- Zero-copy restores. Local hits are restored without copying bytes — via reflink (copy-on-write) where the filesystem supports it (APFS, btrfs, XFS-with-reflink), and via hardlink on other filesystems.
- Content-addressed storage. The store is keyed by blake3 hash, so identical artifact blobs are stored once and linked many times.
- Compile-then-record on misses. Misses compile normally, then kache records the outputs for future builds.
- Daemon-optional locally. If the daemon is not running, local hits and misses still work; remote checks, uploads, and prefetching degrade gracefully.
- Safer on macOS. Incremental compilation is disabled on every platform while kache wraps rustc — artifact caching subsumes it. On macOS this also avoids APFS-related incremental-compilation corruption in git worktrees.
Try it
# install
mise use -g github:kunobi-ninja/kache@latest
# interactive setup: cargo wrapper + login service + daemon start
kache init
# verify
kache doctor
kache init is idempotent — re-run it any time to repair configuration. Prefer to wire things by hand? Just export RUSTC_WRAPPER=kache or set rustc-wrapper = "kache" under [build] in ~/.cargo/config.toml.
Architecture in one screen
- Wrapper —
RUSTC_WRAPPERintercepts rustc calls;CC="kache cc"andCXX="kache c++"intercept supported C/C++ object compiles. Hits restore zero-copy (reflink, falling back to hardlink/copy). - Daemon — background process handles async S3 uploads, remote checks, and prefetch. Auto-restarts on binary update.
- Store — SQLite index at
{cache_dir}/index.db, plus content-addressed blobs under{cache_dir}/store/blobs/; hits restore those blobs intotarget/zero-copy (reflink, falling back to hardlink/copy). - Cache keys — deterministic blake3 hash of rustc version, crate name, source, dependencies, and normalized flags — portable across machines.
Installation
mise, cargo-binstall, or build from source
Quick start
kache init, first build, verifying hits
C/C++ caching
Wrap cc, c++, gcc, clang, and clang-cl object compiles
How it works
Wrapper, store, daemon — the full picture
Cache key
What's hashed and why keys are portable
Remote cache (S3)
AWS, R2, Ceph, MinIO — same config
CI setup
GitHub Actions one-liner via kache-action
Monitor
Live TUI dashboard for builds, store, transfers
Benchmarks
Cold/warm scenarios, sccache comparison, reports, and Perfetto traces
Commands
Every CLI subcommand with flags and examples