Skip to content

reapFallowCaches

reapFallowCaches(opts?): Promise<ReapFallowResult>

Defined in: src/tmp-sweep.ts:385

Ungated reaper for stale fallow-audit-base-cache-* worktree cache dirs. Runs regardless of inode pressure — decoupled from the sweepClaudeTmp threshold gate.

Scans the deduped set of roots [claudeTmpRoot(), join(claudeTmpRoot(), "claude-"+uid()), tmpdir()] (the third catches caches whose TMPDIR was the bare system /tmp). Only considers entries whose name starts with FALLOW_CACHE_PREFIX; ignores .lock/.last-used sidecar files (they are cleaned up alongside their parent dir). For each stale cache dir it removes the dir AND ${dir}.lock AND ${dir}.last-used. Per-entry try/catch — never aborts the pass, never rejects. Returns { removed }.

ReapFallowOpts

Promise<ReapFallowResult>