Before you begin
Use a claude-mem version that includesnpx claude-mem import, and start your local worker with npx claude-mem start.
Use a source API key that can read the user or namespace you select.
The command reads one source scope at a time; it never discovers and imports
every account automatically. No source data is changed or deleted.
Choose a stable --source-account label for the source account, such as
personal-mem0 or company-supermemory. Keep this label when you rotate keys
or repeat an import. It separates records that happen to have matching IDs in
different source accounts. The label is yours; it is not an account credential.
Mem0
SetMEM0_API_KEY in your environment or secret manager. Then run:
imported-memory.
Supermemory
SetSUPERMEMORY_API_KEY in your environment or secret manager. Then run:
--documents:
Preview and verify
Add--dry-run to either command to fetch and validate the selected source
without writing to Claude-Mem. It prints counts, not memory text or keys.
After an import, search for a phrase from one of your memories in the viewer,
or use npx claude-mem search "a phrase you imported". Imported memories are
saved for the default host (claude), so Claude Code’s memory search finds
them. To file them under another host, add --platform <host>, such as
--platform codex or --platform cursor. Imported observations
retain the original source record, ID, timestamps, metadata, account label and
source scope in their metadata. The Claude-Mem observation has a new local
creation time; source timestamps remain provenance.
Repeat an interrupted import
Run the same command again. Exact source records use the worker’s transactional fingerprint check, so records already saved are counted as existing. There is no background job and no automatic write retry. If a response was lost after a save, the next explicit run checks the same fingerprint. Source edits create new observations rather than modifying earlier imports. Source deletion and expiration are not synchronized after import. Future Mem0 expiration dates are preserved as metadata, not scheduled deletion rules. This is a one-way import, not ongoing synchronization or a graph migration.Limits and troubleshooting
- The default limit is 10,000 source records. Set
--max-recordsup to 100,000 for a larger scope. Total source responses are limited to 100 MiB. - Requests have a 15-second deadline;
--timeout-msaccepts up to 120,000. A request failure stops the run with a nonzero exit code. - Source pages are collected and validated before any writes. Duplicate IDs, changing totals, incomplete pages and repeated cursors stop the run. Keep the source quiet during an import; the APIs do not provide a snapshot lock.
- A single text record is limited to 100,000 characters. Oversized records must be split at the source. Text is never silently truncated by this command.
- The destination uses the existing worker URL and local authentication
settings. No provider key is sent to the worker. The Postgres server’s
/v1API and hosted CMEM Pro MCP endpoint are not import destinations here. - Existing worker indexing, cloud sync and export settings still apply to imported observations. This command performs no model calls.
- No configuration is installed. To disconnect, remove the source key from your environment. Already imported memories remain until you delete them through Claude-Mem’s existing controls.
Maintainer verification
Run the contract tests withbun test tests/npx-cli/import-memory.test.ts.
After npm run build, run python3 tests/fixtures/import-provider-smoke.py.
The smoke test uses synthetic provider responses, the actual bundled CLI and
a disposable bundled worker with fresh SQLite. It never accesses a real
provider account or runs a model. Successful fixture tests do not establish
compatibility with every account, plan or live vendor response.
