stevenlzm/mem0/import
Claude Code and agent skill by stevenlzm/mem0
- community
Checking that the SKILL.md file is still in the repository.
Imports memories from an exported Markdown file or MEMORY.md into the current project. Use when migrating from another project, restoring from backup, importing Claude Code native MEMORY.md content, or setting up a new project with existing knowledge.
Install
npx vskill@latest install stevenlzm/mem0/importSKILL.md
The same SKILL.md was published earlier as aidong99418/hermes-skills/import.
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:
If multiple files are found, ask the user which one to import. If none are found, print:
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:
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 typeconfidence— metadata confidence valuebranch— metadata branchfiles— list of associated filescategories— list of categoriescontent— the memory text
If the script fails or outputs [], print:
and stop.
Step 3: Resolve identity
Determine the active identity:
user_idfromMEM0_USER_IDenv var, else$USER, else"default"project_id(used asapp_id) fromMEM0_PROJECT_IDenv 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
Notes:
- Do NOT pass the original
id— the platform assigns a new ID. - Skip records where
contentis empty (the parser already filters these, but be defensive). - Continue importing even if individual records fail; track the count of successes.
Step 5: Print results
Where <N> is the number of successfully imported memories.
If any failed:
Importing from competing AI tools (--tools)
When invoked with --tools (e.g., /mem0:import --tools), detect and import from competing AI tool configuration files:
Supported tools
| Tool | File/directory | |
|---|---|---|
| Cursor | .cursorrules | |
| GitHub Copilot | .github/copilot-instructions.md | |
| Cline | memory-bank/ (directory of .md files) | |
| Continue | .continue/rules.md |
T1: Detect
T2: Ask user
List found files, ask which to import (numbers, comma-separated, or "all"). If none found:
T3: Run import
For each selected tool:
Tools: cursorrules, copilot, cline, continue.
T4: Report
Notes: infer=False, tagged metadata.source=<tool>-import, sections <50 chars skipped, chunks >10k chars truncated, safe to re-run (deduplication handles it).
Importing Claude Code's native MEMORY.md
When invoked with a path to Claude Code's native MEMORY.md file (typically ~/.claude/projects/<proj-key>/memory/MEMORY.md), or when on_session_start.sh detects native auto-memory and the user chooses to import:
- Read the file. It contains newline-separated memory entries (one fact per line,
sometimes with - bullet prefix).
- Split by non-empty lines. Each line becomes one memory.
- Skip lines shorter than 20 characters or lines that are just headers (
#). - For each line, call
add_memorywith:
text="<line>"user_id=<active_user_id>app_id=<active_project_id>metadata={"type": "task_learning", "source": "memory-md-import", "confidence": 0.8}infer=False
- Report:
Imported <N> memories from MEMORY.md into project <project_id> - Suggest disabling native auto-memory:
`` To avoid duplicate memory systems, add to ~/.claude/settings.json: "autoMemoryEnabled": false ``
This handles the cold-start gap when a user has been using Claude Code's native memory and switches to mem0.
Error Handling
- If the parser script is not found at
<PLUGIN_ROOT>/scripts/parse_export_file.py, print an error and stop. - If
add_memorycalls fail consistently (e.g. auth error), report the issue and stop early.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingintegrations/mem0-plugin/skills/import/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/stevenlzm/mem0/import)