Skip to main content
The export and import scripts let you move memory data between Claude Mem installations with automatic duplicate prevention. Use them to share knowledge with teammates, back up specific memory sets, or import community-contributed observations.

Use cases

Share knowledge with teammates

Export bug fix patterns, architectural decisions, or platform-specific learnings and share the JSON file with your team.

Back up memory sets

Export observations about a specific project or topic before migrating machines or resetting your database.

Import community exports

Import observations contributed by others — Windows compatibility fixes, deployment patterns, and more.

Cross-machine sync

Export observations from one machine and import them on another to continue where you left off.

Data directory

All Claude Mem data lives in ~/.claude-mem/:
The export scripts read from this database directly.
Export files contain memory data in plain text. Review exports before sharing to ensure no sensitive information — API keys, passwords, internal hostnames — is included.

Exporting memories

The export script searches the database using hybrid search (ChromaDB vector embeddings combined with SQLite FTS5 full-text search) and exports all matching observations, sessions, summaries, and prompts to a portable JSON file.
Parameters:
  1. <query> — search query (uses hybrid semantic + full-text search)
  2. <output-file> — output JSON file path
  3. --project=name — optional: filter to a specific project
Example output:

Importing memories

The import script reads an export file and inserts records with automatic duplicate prevention. It checks whether each record already exists before inserting, skips duplicates silently, and imports everything inside a single transaction.
Parameters:
  1. <input-file> — path to an export JSON file
Example output:

Re-importing the same file

Running the import script twice on the same file is safe — duplicates are skipped automatically:

Duplicate detection strategy

Export file format

Safety features

Duplicate prevention

Won’t re-import records that already exist in the database.

Transactional imports

All-or-nothing: if the import fails mid-way, the database is rolled back to its previous state.

Read-only export

The export script opens the database in read-only mode and never modifies data.

Dependency ordering

Sessions are imported before observations and summaries to maintain referential integrity.

Advanced usage

Export by project

Export by observation type

Filter by date after export

Use jq to filter an export file by date before importing:

Combine multiple exports

Sharing with others

As an export author:
  1. Export your memories:
  2. Share the JSON file via GitHub Gist, your project repository, or direct transfer.
  3. Document what the export contains — what query was used and who might benefit.
As an import user:
  1. Download the export file.
  2. Optionally inspect it:
  3. Import into your database:
  4. Verify with a search:

Example exports

These commands export useful memory sets that can be shared with others:

Troubleshooting

Make sure Claude Mem is installed and has recorded at least one session. The database is created on first use.
Check the file path. Use an absolute path if the file is not in the current directory.
If the import fails part-way through, the transaction is rolled back and your database remains unchanged. Fix the issue (disk space, file corruption, etc.) and run the import again.

Folder context files

Auto-generated CLAUDE.md files for directory-level context

Search tools

Query your memory database with MCP tools