Skip to main content

user_cache_dir_for

Function user_cache_dir_for 

Source
pub fn user_cache_dir_for(repo_root: &Path) -> PathBuf
Expand description

W2: per-project cache root for transient, non-brain artifacts (proactive hook state, chat REPL output, benchmark output).

Kept OUT of the project’s .kimetsu/ so a brain-only install’s .kimetsu/ stays lean. Lives under the user kimetsu home (~/.kimetsu/cache/<project-id>/), honouring KIMETSU_USER_BRAIN_DIR. Falls back to the OS temp dir when no home resolves, so it NEVER lands back inside .kimetsu/.

The <project-id> component is the same slug produced by default_project_id, which is filesystem-safe (ASCII alphanumeric + hyphens only, non-empty).