Commands
memorize.py
Maps a project and registers it under ~/.lore/<name>. You rarely need it, because an agent registers git projects itself; use it for folders that are not git repositories, to choose the name, to import existing instruction files, or to re-map after the folder structure changes.
Synopsis
python3 memorize.py --path ~/projects/myapp
python3 memorize.py --path ~/projects/myapp --name app # custom name
python3 memorize.py --path ~/projects/myapp --no-import # do not import instruction files
Options
| Option | Meaning |
|---|---|
--path PATH required | The project root to map. ~ is expanded; it must be a directory. |
--name NAME | The project's name. Default: the last component of --path. Letters, digits, ., _ and - only. A name already used by a different folder is refused. |
--no-import | Do not import instruction files the project already has. |
--import-active | Import them as active rules instead of pending ones that wait for your approval. |
What it does
- Maps the project. It lists the files (through
git ls-files -co --exclude-standardwhen git is available, so.gitignoreis honoured; otherwise by walking the tree, skipping folders such asnode_modules,.venv,dist,vendorandtarget). It records the sections with their file counts and languages, the languages overall (by file extension), the manifest files it found (package.json,pyproject.toml,go.mod,Cargo.toml,Makefile, …) and the subfolders of each section. At most 200,000 files are read. No file contents are stored: the result is~/.lore/<name>/map.json. - Registers the project in
project.json, keeping its creation date if it already existed. - Imports existing instruction files (unless
--no-import), reading each of these when present:.github/copilot-instructions.mdand.github/instructions/AGENTS.mdandCLAUDE.md.cursorrules,.cursor/rulesand.windsurfrules
train.py. They arrive as pending, because text that already sits in a repository is not the same as a rule you chose. Files written byreview.py syncare recognised by their marker and never imported.
Example
$ python3 memorize.py --path ~/projects/myapp
Mapped myapp: 4 files, 4 sections; languages: python (2)
docs 1 files -
root 1 files -
src/api 1 files python
tests 1 files python
Imported 1 rule(s) from 1 existing instruction file(s) as pending (approve them with review.py or the web UI); 0 duplicates skipped
Memory: /home/you/.lore/myapp
Next: train.py --name myapp --from <folder> | review.py --name myapp list
Notes
- Safe to repeat. Re-running updates the map and keeps your rules. Near-identical rules are not imported twice.
- Re-map after adding folders. Section-scoped rules and the static export need the section to exist in the map.
- Automatic registration differs. When an agent registers a project by itself, it does not import instruction files: the agent's own client already loads them, and a just-cloned repository is not trusted to write rules. See automatic mode.
- Imported text goes through the same hygiene checks as any rule; entries that fail are counted and reported ("N rule(s) refused").