import

An importer for bringing memories from a Markdown export file or Claude Code's MEMORY.md into the current Mem0 project. Mem0 is a service that stores knowledge for coding agents.

In plain words
What is it for?
Use it to migrate exported memories, restore saved knowledge, or import an existing MEMORY.md file.
Why use it?
It avoids re-entering existing project knowledge when moving projects, restoring a backup, or starting with memories from another tool.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mem0ai/mem0/import
Any agent
npx skills add mem0ai/mem0 --skill import
Clone the repo
git clone --depth 1 https://github.com/mem0ai/mem0

Made for: Claude Code, Codex.

Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,463 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00046 $0.01463
Opus 5 $0.00023 $0.00732
Sonnet 5 $0.00009 $0.00293
Haiku 4.5 $0.00005 $0.00146

Measured 2d ago against content hash ba1cbdcc8141, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

import scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

To avoid duplicate memory systems, add to ~/.claude/settings.json:
integrations/mem0-plugin/skills/import/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mem0 Import

Import memories from a mem0 export file into the current project.

Execution

Step 1: Determine the export file to import

If the user provided a filename as an argument to /mem0:import <filename>, use that file.

Otherwise, list .md files in the current directory whose names contain mem0-export:

ls -1 *.md 2>/dev/null | grep mem0-export || echo "No export files found"

If multiple files are found, ask the user which one to import. If none are found, print:

No mem0-export files found in the current directory.
Run /mem0:export first, or provide the filename: /mem0:import <path-to-file>

Step 2: Parse the export file

Determine the plugin root. Use the appropriate variable for the current platform:

  • Claude Code: ${CLAUDE_PLUGIN_ROOT}
  • Codex: ${CODEX_PLUGIN_ROOT}
  • Cursor: ${CURSOR_PLUGIN_ROOT}

Run the parser script to extract memory records as JSON:

python3 "<PLUGIN_ROOT>/scripts/parse_export_file.py" "<path-to-export-file>"

This outputs a JSON array where each element has:

  • id — original memory ID (for reference only; a new ID will be assigned on import)
  • type — metadata type
  • confidence — metadata confidence value
  • branch — metadata branch
  • files — list of associated files
  • categories — list of categories
  • content — the memory text

If the script fails or outputs [], print:

Failed to parse <filename> or file contains no valid memory blocks.

and stop.

Step 3: Resolve identity

Determine the active identity:

  • user_id from MEM0_USER_ID env var, else $USER, else "default"
  • project_id (used as app_id) from MEM0_PROJECT_ID env var, or via the project resolver

Step 4: Import each memory

For each record in the parsed JSON array, call add_memory with:

  • text="<record.content>"
  • user_id=<active_user_id>
  • app_id=<active_project_id>
  • metadata={
    • "type": "<record.type>" (if non-empty)
    • "confidence": "<record.confidence>" (if non-empty)
    • "branch": "<record.branch>" (if non-empty)
    • "files": <record.files> (the list, if non-empty)
    • "source": "import"
    • }
  • infer=False

Read the full file on GitHub · 178 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 178 lines · 46 tokens per session scan B ba1cbdcc8141

Subscribe to this mod's changes

import is a skill published in the GitHub repository mem0ai/mem0 (64,535 stars, last pushed today), licensed Apache-2.0. It adds 46 tokens to every session and 1,463 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.