Where the cache lives
By default the store lives under~/.cache/rbs (the content store itself sits in a
versioned subdirectory, e.g. ~/.cache/rbs/v1). To relocate it — for example onto a
larger volume — set RBS_CACHE_DIR:
.rbs/ directory is not a cache. It holds only materialized
state — build outputs, toolchain links, resolved external dependencies — all of which
rbs recreates on demand. Deleting .rbs/ forces a rebuild but loses nothing durable.
What gets cached
The store holds two kinds of entries:- Content blobs — the files actions produce (and consume), addressed by their content hash. Identical content is stored once, no matter how many targets or workspaces reference it.
- Action results — a record that a given action (command + inputs + environment) already ran, pointing at the blobs it produced. When you rebuild, rbs looks up each action here and restores its outputs instead of re-executing it.
rbs cache
commands manage with the same age bounds:
- OCI images — container images pulled for image-based rules
- Toolchains — downloaded language toolchains (see Toolchains)
- External deps — resolved third-party packages (see External dependencies)
- Terraform providers — provider plugins downloaded for infra targets
Inspecting the cache
stats also breaks down that workspace’s materialized
.rbs/ state, one line per top-level directory — useful for seeing where local disk
usage actually is:
Bounding the cache: rbs cache gc
Garbage collection is the recommended way to keep the cache in check. It sweeps
entries by age first, then evicts the least-recently-used content until the store is
under its size budget:
Age values support weeks and days on top of the usual units:
2w, 7d, 24h,
30m, 90s.
The same pass also ages out the OCI image cache, the toolchain store, the
external-deps store, and Terraform providers. Anything swept is rebuilt or
re-downloaded automatically the next time it’s needed.
Removing entries: rbs cache clean
clean removes store entries outright:
rbs cache clean — with no flags — is refused:
--max-age or --all. Everything clean removes is
rebuildable — but after --all, every build on the machine starts from scratch.