Skip to content
Getting Started

Try Kache in one shell

From a Rust project:

RUSTC_WRAPPER=kache cargo build
cargo clean
KACHE_PROGRESS=hits RUSTC_WRAPPER=kache cargo build
kache stats

The first build fills the local cache. cargo clean makes Cargo request the same outputs again, so the second build can demonstrate restores. Do not add cargo clean to a normal build workflow.

This trial does not edit Cargo configuration or install a service.

Enable Kache permanently

kache init

init configures Cargo, installs the daemon as a login service, and starts it. It is safe to run again when repairing a setup.

Useful variants:

kache init --check       # print proposed changes only
kache init --no-service  # configure Cargo without a login service
kache init --yes         # accept defaults without prompts

To configure Cargo yourself, use either the environment or Cargo config:

export RUSTC_WRAPPER=kache
[build]
rustc-wrapper = "kache"

Check the setup

kache doctor
kache monitor

doctor checks wrapper configuration, conflicting wrappers, config parsing, and daemon access. monitor shows hits, misses, passthroughs, store use, and remote transfers.

For a non-interactive check:

kache stats
kache list

Worktrees

Share the Kache store across worktrees, but give concurrent Cargo builds separate target directories. Cargo owns target/ fingerprints and can mark a unit fresh without invoking any compiler wrapper.

On Cargo 1.91 or newer, this command keeps intermediate fingerprints worktree-local while allowing final target output to be shared:

kache cargo -- build

Otherwise set a distinct CARGO_TARGET_DIR per live worktree.

Executables and incremental builds

Kache caches eligible Rust executables by default on Linux and macOS. The default is off on Windows because executable debug information still refers to an external PDB path. Override the policy with KACHE_CACHE_EXECUTABLES or cache.cache_executables.

Normal artifact-cached builds strip Cargo's incremental directory argument. Adaptive incremental mode, enabled by default, learns rapidly changing Cargo units and temporarily gives them isolated incremental state. Use KACHE_ADAPTIVE_INCREMENTAL=0 to turn that off or KACHE_PRESERVE_INCREMENTAL=1 to force the incremental path for diagnostics.

Temporarily disable caching

KACHE_DISABLED=1 cargo build

This keeps the wrapper in place but passes compiler work through.

For C and C++, continue with C/C++ caching.

Available for:
Apple macOS logomacOSMicrosoft Windows logoWindowsLinux logoLinux
Download Kunobi