pub struct MemoryRoot { /* private fields */ }Expand description
Root directory of Claude Code’s per-project state. Defaults to
~/.claude/projects (memory directories live under each project
slug); override with MemoryRoot::at for tests or non-default
installs.
Implementations§
Source§impl MemoryRoot
impl MemoryRoot
Sourcepub fn home() -> Result<Self>
pub fn home() -> Result<Self>
Resolve the default ~/.claude/projects. Errors if $HOME
(or the platform-specific user home) cannot be determined.
Sourcepub fn at(path: impl Into<PathBuf>) -> Self
pub fn at(path: impl Into<PathBuf>) -> Self
Use a specific path as the projects root. Useful for tests (point at a tempdir) and for non-default installs.
Sourcepub fn list_projects_with_memory(&self) -> Result<Vec<ProjectMemorySummary>>
pub fn list_projects_with_memory(&self) -> Result<Vec<ProjectMemorySummary>>
List every project slug that has a memory/ directory,
sorted by slug. Projects without one are omitted; a missing
root returns an empty vec.
Sourcepub fn list(&self, slug: &str) -> Result<Vec<MemorySummary>>
pub fn list(&self, slug: &str) -> Result<Vec<MemorySummary>>
List one project’s memory files, sorted by file stem.
MEMORY.md (the index) is excluded; read it with
Self::index. A project without a memory directory (or an
unknown slug) returns an empty vec. Files that fail to read
contribute a tracing warning and are skipped.
Trait Implementations§
Source§impl Clone for MemoryRoot
impl Clone for MemoryRoot
Source§fn clone(&self) -> MemoryRoot
fn clone(&self) -> MemoryRoot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more