sweepClaudeTmp
sweepClaudeTmp(
opts?):Promise<SweepResult>
Defined in: src/tmp-sweep.ts:241
Threshold-gated inode guard. TOTAL by contract: it NEVER throws or rejects — any
unexpected error resolves to { swept:false, reason:"error", removed:0 } after logging,
so a caller can fire-and-forget it on a timer without a guard.
Only sweeps once inode use ≥ thresholdPct; below that it removes NOTHING. When it does
sweep, it walks root and the nested root/claude-$uid, removing node-compile-cache
wholesale (pure cache) and age-gating known regenerable tool caches (see REGENERABLE_CACHE),
while LEAVING per-session/unknown scratch in place, the nested scratch dir itself (its
children are swept when it is the sweep root), and every root dir itself. Age-gating is
evaluated at stat time: an entry that looks fresh by mtime is kept. This is a best-effort age
check, not a TOCTOU-atomic guarantee — a writer touching an entry between our stat and rm is
not fenced out.
Parameters
Section titled “Parameters”SweepOpts
Returns
Section titled “Returns”Promise<SweepResult>