Skip to main content

resolve_auto_db

Function resolve_auto_db 

Source
pub fn resolve_auto_db(
    env_project_dir: Option<&OsStr>,
    cwd: &Path,
    home: &Path,
) -> PathBuf
Expand description

Where --auto looks for a database, in order.

  1. $CLAUDE_PROJECT_DIR/mushroom-memory — the assistant tells a hook which project it is working in, and that is the most specific answer there is.
  2. <cwd>/mushroom-memory, but only when the working directory is a git checkout. Without that guard a command run from a home directory would quietly create a store there.
  3. <home>/.mushroomdb/memory, the user-scope default install writes.

The two project-scoped answers match install::default_db, so a hook with --auto finds the store install --project created.