Skip to main content

memanto memory sync

Recall an agent’s highest-value standing memories and write them into the instruction files of the coding agents you connected with memanto connect — so they are in context from the first message of a session.
Options:
  • --agent, -a TEXT - Agent to sync from (default: the active agent)
  • --project-dir, -p PATH - Project directory whose connections are updated (default: current directory)
  • --connection TEXT - Update only this connected integration (e.g. claude-code, codex, cursor) — use it when running sync by hand and the target is ambiguous
  • --scope TEXT - Update only local or global connections
  • --limit, -n INTEGER - Maximum memories to inject, 1100 (default: 10). With --okf, the maximum per memory type.
  • --okf - Sync an OKF bundle into <project-dir>/okf/ instead
  • --split TEXT - OKF layout: auto (default), file, or type (only used with --okf)
Examples: Sync the active agent into this project’s connected agents:
Sync a specific agent into another project:
Update only the global Claude Code instructions:
Sync a browsable OKF bundle into a project (see the OKF integration):
Output:

What gets injected

sync runs one semantic recall for global project standards, architectural rules, agent workflows, and core user preferences, restricted to:
  • types instruction, preference, and goal
  • active memories with a confidence of at least 0.8
Each result is written as one line, - [TYPE] content, between the dynamic-memory sentinels that memanto connect places in every instruction file:
Each sync replaces the block. If nothing qualifies, the block is emptied and sync prints No active dynamic memories found. Cleared dynamic sections (if any). Nothing outside the sentinels is touched, and memanto connect update leaves the block alone.

Which files are updated

sync updates the instruction file of each connection registered for the project:
  1. With --connection, only that integration.
  2. Otherwise, every integration connected locally to --project-dir; if there are none, every integration connected globally.
  3. --scope local or --scope global restricts either case to that scope.
A file without the dynamic-memory sentinels (for example, one written by an older release) is reported as has no dynamic section and left unchanged — run memanto connect update to add them. If no connection applies, sync exits with No Memanto connections found for <project>. Run 'memanto connect' first. Notes:
  • sync no longer writes a project MEMORY.md. For a full markdown snapshot of an agent’s memories, use memanto memory export.
  • Connected agents run sync for you: the claude-code, codex, and cursor connectors install session-start and pre-compaction hooks, pi gets a session-start extension, and the instruction template tells every agent to sync at the start of a fresh session.
  • After syncing, sync prints a one-line notice if any connected agent is running an older instruction template. Run memanto connect update to refresh them.
  • With --okf, sync exports a fresh bundle into <project-dir>/okf/. If the backend is unreachable, it reuses the previous bundle (reported as stale-cache) rather than emptying the directory.