Skip to content
Development
Skill

/cortex-import

Import memories from other AI memory systems into Cortex. Supports claude-mem (SQLite), Claude Desktop sessions, ChatGPT web export (JSON), Gemini Takeout (JSON), Cursor conversations, and Claude Code JSONL. Use when the user says 'import from claude-mem', 'migrate memories',

From plugin
hypermnesia-mcp
7613 skills5 agents4 commands1 MCP

Claude Code

$ npx -y skills add cdeust/Cortex --skill cortex-import --agent claude-code

SKILL.md

cortex-import.SKILL.md
name: cortex-import
description: "Import memories from other AI memory systems into Cortex. Supports claude-mem (SQLite), Claude Desktop sessions, ChatGPT web export (JSON), Gemini Takeout (JSON), Cursor conversations, and Claude Code JSONL. Use when the user says 'import from claude-mem', 'migrate memories', 'import ChatGPT history', 'import from Gemini', 'transfer memories', or when Cortex detects another memory system is installed."

Import Memories — Multi-Source Migration

Detect available memory sources and import them into Cortex. Run fully autonomously — detect, import, consolidate.

Phase 1: Source Detection

Run this bash command to detect all sources:

echo "=== Memory Sources ==="

# 1. Claude Code JSONL
CC=$(find ~/.claude/projects -name "*.jsonl" 2>/dev/null | wc -l | tr -d ' ')
echo "Claude Code JSONL: $CC files"

# 2. Claude Desktop sessions
CD=$(find ~/Library/Application\ Support/Claude/claude-code-sessions -name "*.json" 2>/dev/null | wc -l | tr -d ' ')
echo "Claude Desktop: $CD session files"

# 3. claude-mem
if [ -f ~/.claude-mem/claude-mem.db ]; then
    CM=$(sqlite3 ~/.claude-mem/claude-mem.db "SELECT COUNT(*) FROM observations" 2>/dev/null || echo "0")
    echo "claude-mem: $CM observations"
else
    echo "claude-mem: not found"
fi

# 4. ChatGPT — desktop app stores binary, need web export
CHATGPT=$(find ~/Downloads -name "conversations.json" -maxdepth 3 2>/dev/null | head -1)
if [ -n "$CHATGPT" ]; then
    echo "ChatGPT export: $CHATGPT"
else
    echo "ChatGPT: no export (get from chatgpt.com → Settings → Data controls → Export)"
fi

# 5. Gemini Takeout
GEMINI=$(find ~/Downloads -path "*Gemini*" -name "*.json" -maxdepth 5 2>/dev/null | head -1)
if [ -n "$GEMINI" ]; then
    echo "Gemini export: $GEMINI"
else
    echo "Gemini: no export (get from takeout.google.com → select Gemini Apps)"
fi

# 6. Cursor
if [ -d ~/.cursor ]; then
    CU=$(find ~/.cursor -name "*.jsonl" 2>/dev/null | wc -l | tr -d ' ')
    echo "Cursor: $CU files"
else
    echo "Cursor: not installed"
fi

Report findings, then proceed with each detected source.

Phase 2: Claude Code Import

If Claude Code JSONL files exist (always the case):

cortex:backfill_memories({"max_files": 500, "min_importance": 0.3, "force_reprocess": false})

Phase 3: claude-mem Import

If `~/.claude-mem/claude-mem.db` exists, run:

DEPS_DIR="$HOME/.claude/plugins/data/hypermnesia-mcp-cortex-plugins/deps"
PYTHONPATH="${CLAUDE_PLUGIN_ROOT:-/Users/cdeust/.claude/plugins/marketplaces/cortex-plugins}:$DEPS_DIR" \
DATABASE_URL="${DATABASE_URL:-postgresql://localhost:5432/cortex}" \
python3 -c "
import sqlite3, json, asyncio, sys, os

db_path = os.path.expanduser('~/.claude-mem/claude-mem.db')
conn = sqlite3.connect(db_path)
conn.row_factory = sqlite3.Row
rows = conn.execute('SELECT type, title, narrative, facts, concepts, created_at_epoch, project FROM observations ORDER BY created_at_epoch').fetchall()
print(f'Found {len(rows)} claude-mem observations')

from mcp_server.handlers.remember import handler as remember_handler
from datetime import datetime, timezone
imported = 0
for row in rows:
    parts = []
    if row['title']: parts.append(row['title'])
    if row['narrative']: parts.append(row['narrative'])
    if row['facts']:
        try:
            for f in json.loads(row['facts']): parts.append(str(f))
        except: pass
    content = '\n'.join(parts)
    if len(content) < 20: continue
    tags = ['imported', 'claude-mem']
    if row['type']: tags.append(row['type'])
    if row['concepts']:
        try: tags.extend(json.loads(row['concepts'])[:5])
        except: pass
    created_at = None
    if row['created_at_epoch']:
        try: created_at = datetime.fromtimestamp(row['created_at_epoch'], tz=timezone.utc).isoformat()
        except: pass
    result = asyncio.run(remember_handler({'content': content, 'tags': tags, 'domain': row['project'] or '', 'source': 'claude-mem', 'force': True, 'created_at': created_at}))
    if result.get('stored'): imported += 1
print(f'Imported {imported} memories from claude-mem')
conn.close()
"

Phase 4: ChatGPT Import

If a `conversations.json` file was found in Downloads, or the user provides one:

DEPS_DIR="$HOME/.claude/plugins/data/hypermnesia-mcp-cortex-plugins/deps"
PYTHONPATH="${CLAUDE_PLUGIN_ROOT:-/Users/cdeust/.claude/plugins/marketplaces/cortex-plugins}:$DEPS_DIR" \
DATABASE_URL="${DATABASE_URL:-postgresql://localhost:5432/cortex}" \
python3 -c "
import json, asyncio, sys, os
path = 'REPLACE_WITH_PATH_TO_CONVERSATIONS_JSON'
with open(path) as f: data = json.load(f)
from mcp_server.handlers.remember import handler as remember_handler
from datetime import datetime, timezone
imported = 0
for conv in data:
    title = conv.get('title', '')
    for nid, node in (conv.get('mapping') or {}).items():
        msg = node.get('message') or {}
        if not msg: continue
        role = (msg.get('author') or {}).get('role', '')
        if role not in ('user', 'assistant'): continue
        parts = msg.get('content', {}).get('parts', [])
        text = '\n'.join(str(p) for p in parts if isinstance(p, str))
        if len(text) < 30: continue
        created_at = None
        ct = msg.get('create_time')
        if ct:
            try: created_at = datetime.fromtimestamp(ct, tz=timezone.utc).isoformat()
            except: pass
        result = asyncio.run(remember_handler({'content': text[:4000], 'tags': ['imported', 'chatgpt', role], 'domain': title[:50] or 'chatgpt', 'source': 'chatgpt', 'force': False, 'created_at': created_at}))
        if result.get('stored'): imported += 1
print(f'Imported {imported} memories from ChatGPT')
"

If no export file exists, tell the user: > ChatGPT desktop app stores conversations in binary format — not readable. To import, export from the web: > 1. Go to **chatgpt.com → Settings → Data controls → Export data** > 2. Wait for the email with the download link > 3. Unzip to ~/Downloads/ > 4. Run

Read more
@cdeust
Ships withhypermnesia-mcp

Cross-platform persistent memory MCP for Codex, Gemini CLI, Claude Code, and other local MCP hosts. 36 cited neuroscience mechanisms, local-first SQLite/PostgreSQL, hybrid retrieval, decay-based consolidation, and reproducible benchmarks. Claude adds optional automatic lifecycle hooks.

7613 skills5 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
76
Star history of cdeust/Cortex on GitHub, a chart by star-history.com

Other skills on hypermnesia-mcp.

cortex-automate

cortex-automate

Set up automation — prospective memory triggers, neuro-symbolic rules, and CLAUDE.md sync. Use when the user says 'remind me…

cortex-consolidate

cortex-consolidate

Run memory maintenance — decay old memories, compress stale content, consolidate episodic memories into semantic knowledge, and…

cortex-debug-memory

cortex-debug-memory

Debug and fix memory system issues — validate memories, rate quality, manage protection, forget bad memories, and restore from…

cortex-profile

cortex-profile

View and manage your cognitive profile — how you think, work patterns, blind spots, and cross-domain connections. Use when the…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about cortex-import.

Which coding agents can use cortex-import?
cortex-import installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.