Skip to main content

Module memory

Module memory 

Source
Expand description

Read-only mirror of a coding tool’s per-project memory store. Read-only mirror of a coding tool’s per-project memory store.

Coding tools such as Claude Code write per-project “memory” (running notes, next steps, corrections) into their own private stores that other tools cannot see. This module mirrors those files into Lore’s memories table so any LLM can read them through Lore’s MCP server.

The mirror is strictly READ-ONLY: it never creates, modifies, or deletes files in the tool’s memory folder. It only reflects the current folder state into the database, adding new memories, updating changed ones, and removing memories whose source file no longer exists.

Claude Code stores per-project data under ~/.claude/projects/<slug>/ where <slug> is the project’s absolute path with the path separator replaced by - (for example /Users/me/proj becomes -Users-me-proj). Sessions live in the sessions/ folder; memory lives in the sibling memory/ folder as a MEMORY.md index plus per-fact markdown files. Each fact file carries YAML frontmatter with name, description, and metadata.type, followed by the fact body.

Structs§

MemoryMirror
Mirrors a coding tool’s memory folder into Lore’s database.
MirrorStats
Statistics describing what a single refresh changed.
ParsedMemory
A memory parsed from a single markdown file on disk.

Constants§

CLAUDE_CODE_TOOL
The source-tool identifier used for Claude Code memories.

Functions§

parse_memory_dir
Parses all memory markdown files in a folder.
resolve_project_path
Resolves the project path to scope memories to.