Skip to main content

Memory Ingest

Claude Code maintains its own auto-memory — markdown it distills for itself — under:
<encoded-cwd> is the repo’s absolute path with every / replaced by - (e.g. /home/you/code/app → -home-you-code-app). claude-mem memory ingest imports those topic files directly into your memory database as observations.

Why it doesn’t cost anything

Auto-memory is already distilled — each topic file is the same kind of artifact the observation generator produces. So memory-ingest does not run the Haiku generation pipeline. It stores each file’s prose directly through claude-mem’s existing observation seam (content-hash dedup + Chroma sync). Re-running generation on already-distilled prose would be lossy and pay for negative value. The MEMORY.md index is skipped — it’s just links and carries no knowledge of its own.

Usage

Always dry-run first — it’s a zero-spend, DB-free scan + count:
Then run the real ingest:

Flags

How it runs

  • --dry-run is pure parse + count — it runs entirely in the CLI process, touches no worker and no database, and spends nothing.
  • The real ingest stores into the SQLite observation database, which lives in the worker. The CLI starts the worker if needed and drives the import over HTTP (POST /api/memory/ingest), mirroring how transcript ingest and summaries reach the worker. Bulk imports are not time-limited.
  • A file that cannot be read is reported as failed; the rest of the import carries on. A source outside the projects directory, or one that does not exist, is a 400 from the worker.
  • Only the memory notes are imported. A sibling transcript is read for its cwd, to key the project like live capture does; its content is never ingested.

Frontmatter

Topic files carry a small YAML frontmatter block, which is preserved as observation metadata:
metadata.type (e.g. project, feedback, reference, user) and metadata.originSessionId are carried through; files without frontmatter are stored using their body as-is.

Idempotency

Ingest is safe to re-run. Observations are content-hash deduplicated on insert, so already-imported files are reported as already-imported and skipped — only new or changed files are stored. The summary line reports the outcome:
  • Memory Export/Import — share memory sets between installations.
  • Transcript backfill (claude-mem transcript ingest) — the sibling path that imports raw Claude Code session JSONL and does run generation.