> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# memanto memory sync

> Sync agent memories into a project's MEMORY.md file.

# memanto memory sync

Sync memories to MEMORY.md for Claude Code integration.

```bash theme={null}
memanto memory sync [OPTIONS]
```

**Options:**

* `--agent TEXT` - Specific agent
* `--project-dir PATH` - Target project directory (default: current directory)
* `--limit INTEGER` - Maximum memories per type to include, `1`–`100` (default: `25`)
* `--okf` - Sync an [OKF](/integrations/okf) bundle into `<project-dir>/okf/` instead of `MEMORY.md`
* `--split TEXT` - OKF layout: `auto` (default), `file`, or `type` (only used with `--okf`)

**Examples:**

Sync active agent:

```bash theme={null}
memanto memory sync
```

Sync specific agent:

```bash theme={null}
memanto memory sync --agent customer-support
```

Sync into a specific project:

```bash theme={null}
memanto memory sync --project-dir ./my-project
```

Sync a browsable OKF bundle into a project (see the [OKF integration](/integrations/okf)):

```bash theme={null}
memanto memory sync --okf --project-dir ./my-project
```

**Output:**

```
✓ Memories synced to MEMORY.md
  Agent: customer-support
  Memories: 42
  File: ./MEMORY.md
```

**Notes:**

* If a fresh export fails because the backend is unreachable, `sync` falls back to the previous export instead of wiping `MEMORY.md` with an empty one — the project's memory file only goes stale, never blank.
* With `--okf`, the same fallback applies: on a backend outage `sync` reuses the previous OKF bundle (reported as `stale-cache`) rather than emptying `<project-dir>/okf/`.
