From a32dff06f951e558d90a5a3a28c8a2772a93eb53 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 4 Apr 2026 01:11:06 -0400 Subject: [PATCH] Delete obsolete loading of memory files from projects dir Signed-off-by: Kent Overstreet --- src/user/identity.rs | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/user/identity.rs b/src/user/identity.rs index d988ebf..0a71d71 100644 --- a/src/user/identity.rs +++ b/src/user/identity.rs @@ -80,9 +80,7 @@ fn load_memory_files(cwd: &Path, memory_project: Option<&Path>, context_groups: // Primary config directory let config_dir = home.join(".consciousness/identity"); let global = home.join(".consciousness"); - let project = memory_project - .map(PathBuf::from) - .or_else(|| find_project_memory_dir(cwd, &home)); + let project = memory_project.map(PathBuf::from); let mut memories: Vec<(String, String)> = Vec::new(); @@ -135,29 +133,6 @@ fn load_memory_files(cwd: &Path, memory_project: Option<&Path>, context_groups: memories } -/// Find the Claude Code project memory directory for the given cwd. -/// Claude Code mangles the path: /home/kent/foo → -home-kent-foo -fn find_project_memory_dir(cwd: &Path, home: &Path) -> Option { - let projects_dir = home.join(".claude/projects"); - if !projects_dir.exists() { return None; } - - // Try direct cwd match, walking up to git root - let mut dir = Some(cwd); - while let Some(d) = dir { - let mangled = d.to_string_lossy().replace('/', "-"); - let candidate = projects_dir.join(&mangled).join("memory"); - if candidate.exists() { return Some(candidate); } - if d.join(".git").exists() { break; } - dir = d.parent(); - } - - // Fallback: first project dir with identity.md - std::fs::read_dir(&projects_dir).ok()? - .flatten() - .map(|e| e.path().join("memory")) - .find(|m| m.join("identity.md").exists()) -} - /// Discover instruction and memory files that would be loaded. /// Returns (instruction_files, memory_files) as (display_path, chars) pairs. pub fn context_file_info(prompt_file: &str, memory_project: Option<&Path>, context_groups: &[ContextGroup]) -> (Vec<(String, usize)>, Vec<(String, usize)>) {