Type to search the docs and updates.

Browse documentation

Memory commands

memory

Check, list, locate, and repair shared memory for the project the working directory is in. Every subcommand finds the project from any folder below its root: the nearest folder, from the working directory up, with a config or a memory folder. The search stops at the root of the Git checkout, which is the project when nothing is found. From a subfolder, lint and index print paths from the working directory, or in full when the working directory is reached through a link. The command checks project memory in .agnostic-ai/memory/ before personal memory in .agnostic-ai/local/memory/. With memory.personal: repo, it uses the shared personal folder. Missing folders are skipped. When neither folder exists, lint, list, and index print No memory store found and exit 0; --quiet hides that line for list and index.

agnostic-ai memory lint     # run only the memory checks
agnostic-ai memory index    # rebuild each MEMORY.md from its fact files
agnostic-ai memory list     # print each fact's scope, type, and title
agnostic-ai memory path     # print each memory folder's absolute path
agnostic-ai memory import --from claude   # copy facts from another memory store
  • memory lint reports LINT039 to LINT044 and LINT067, the memory findings lint and doctor also report. It exits 1 on an error, or on a warning with --strict, and exits 0 when no memory folder exists. --json prints the lint --json format with command set to memory lint.
  • memory index drops merge conflict markers, links to missing files, and repeated links, keeping every other line. It then adds a - [name](file.md): description line, from the fact's YAML fields, for each fact without one. With the memory built-in on, it creates a missing project index, empty when there are no facts (LINT067). It prints one status line per index, which --quiet drops.
  • memory list prints facts in index order, titled by the index line's link text, or the fact's name when no line links it. The type comes from metadata.type, or a top-level type as Claude Code's auto memory writes it. With no fact it prints No facts..
  • memory path prints one scope folder line per memory folder, project first, as absolute paths, even for a folder not created yet. It works from any folder in the project and from a linked worktree; with memory.personal: repo, every worktree gets the same personal folder. Tools without a session-start hook run it, as the shared-memory-policy rule asks.
  • memory import copies fact files into personal memory, which every tool reads, and adds their index lines. --from claude reads Claude Code's store from before sync pointed it at personal memory; --from checkout and --from repo read the other personal folder after a memory.personal switch; --path reads any folder with a MEMORY.md and one file per fact.
How memory import copies, skips, and records facts

The source stays unchanged, and so does an existing destination file. Source index lines that link no fact become a fact of their own (claude-index-notes.md for --from claude). Symlinks and files with a line that looks like a secret are skipped and named. An identical fact without an index line gets its line back, so a rerun finishes an interrupted import.

Import refuses a personal folder holding tracked files, and first adds the checkout folder to Git's exclude list if Git would track it. It records handled facts in .imported there, so LINT043 stops counting facts you later delete or merge.

To leave a fact behind, decline it. --skip <file> declines one fact and --skip-rest declines every fact not imported yet. Without --only, they copy nothing. Import records each decline in .declined in personal memory, with a checksum of the fact. LINT043 stops counting a declined fact, and a plain import or sync leaves it out. If the fact changes in the source, it counts again. A file import cannot read is declined by name only, so a change does not bring it back. To import a declined fact, name it with --only.

FlagDescription
--strictWith memory lint, exit 1 on warnings too.
--jsonWith memory lint, print {version, command, findings}.
--fromWith memory import, the store to copy from: claude, checkout, or repo.
--pathWith memory import, a folder to copy from instead of --from.
--onlyWith memory import, copy only this fact file; repeat the flag for more.
--skipWith memory import, decline this fact file so LINT043 stops counting it; repeat the flag for more.
--skip-restWith memory import, decline every fact not imported yet, after copying the --only picks.
--dry-runWith memory import, list which facts are already imported, declined, and pending, and write nothing.