cortex-import skill
✓ VerifiedMigrate and consolidate AI memories from multiple sources including Claude, ChatGPT, Gemini, and Cursor into the Cortex system.
- GitHub stars
- 76
- Files
- 1
- Last commit
- Nov 12, 2026
- License
- MIT
- Allowed tools
- —
What does the cortex-import skill do?
cortex-import is an agent skill. Migrate and consolidate AI memories from multiple sources including Claude, ChatGPT, Gemini, and Cursor into the Cortex system.
Summary generated from the skill's SKILL.md.
About the cortex-import skill
Consolidating AI memories from various platforms into a single system is what cortex-import enables for developers and power users. This skill automates the migration of historical data from Claude Desktop sessions, Claude Code JSONL files, ChatGPT web exports, Gemini Takeout JSON files, Cursor conversations, and the claude-mem SQLite database. An agent should load this skill when a user requests to migrate memories, transfer history, or consolidate their AI interactions.
The process begins with an autonomous detection phase that scans local directories and downloads for compatible files. Once sources are identified, the skill uses specific Python scripts and the backfill_memories tool to ingest content. It handles the extraction of text, tags, and timestamps to ensure the new Cortex system maintains the context of previous conversations. After the data is moved, the skill provides tools to consolidate the new information and view memory statistics to verify the successful transfer of data.
What an agent can do with it
- 1Migrate Claude Code historyAn agent can move your existing Claude Code JSONL files into the Cortex system using the backfill tool.
- 2Import ChatGPT web exportsYou can transfer your conversation history from ChatGPT by providing the JSON export file from your web settings.
- 3Consolidate multiple memory sourcesAfter importing data from different AI providers, use the consolidation tool to organize the new memories.
- 4Transfer Gemini Takeout dataMove your Gemini Apps history into Cortex by scanning your Google Takeout JSON files.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the cortex-import skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the cortex-import skill in Plugin
/plugin marketplace add cdeust/Cortex /plugin install hypermnesia-mcp@cortex-plugins
Install the cortex-import skill in Claude Code
~/.claude/skills/cortex-import/SKILL.md
$ npx degit cdeust/Cortex/skills/cortex-import ~/.claude/skills/cortex-importInstall the cortex-import skill in Claude Code (project)
.claude/skills/cortex-import/SKILL.md
$ npx degit cdeust/Cortex/skills/cortex-import .claude/skills/cortex-importInstall the cortex-import skill in Codex
~/.agents/skills/cortex-import/SKILL.md
$ npx degit cdeust/Cortex/skills/cortex-import ~/.agents/skills/cortex-importInstall the cortex-import skill in Gemini CLI
~/.gemini/skills/cortex-import/SKILL.md
$ npx degit cdeust/Cortex/skills/cortex-import ~/.gemini/skills/cortex-importInstall the cortex-import skill in Claude.ai
npx degit cdeust/Cortex/skills/cortex-import cortex-import && zip -r cortex-import.zip cortex-import # claude.ai → Customize → Skills → + → Create skill → Upload a skill → cortex-import.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachablecdeust/cortex/skills/cortex-import is public and reachablegithub.com/cdeust/cortex/tree/HEAD/skills/cortex-import ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-12github.com/cdeust/cortex/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/cdeust/cortex/blob/HEAD/skills/cortex-import/SKIL ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/cdeust/cortex/blob/HEAD/skills/cortex-import/SKIL ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 206 linesgithub.com/cdeust/cortex/blob/HEAD/skills/cortex-import/SKIL ↗Pass
SKILL.md
View on GitHubImport 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:
- Go to chatgpt.com → Settings → Data controls → Export data
- Wait for the email with the download link
- Unzip to ~/Downloads/
- Run
/cortex-importagain
Phase 5: Gemini Import
If Gemini Takeout JSON files found, scan the Gemini Apps/ folder for conversation JSON:
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, glob
gemini_dir = 'REPLACE_WITH_PATH_TO_GEMINI_TAKEOUT'
files = glob.glob(os.path.join(gemini_dir, '**/*.json'), recursive=True)
from mcp_server.handlers.remember import handler as remember_handler
imported = 0
for fp in files:
try:
with open(fp) as f: data = json.load(f)
except: continue
if not isinstance(data, list): data = [data]
for item in data:
parts = item.get('parts', [])
for part in parts:
text = part.get('text', '')
if len(text) < 30: continue
result = asyncio.run(remember_handler({'content': text[:4000], 'tags': ['imported', 'gemini'], 'domain': 'gemini', 'source': 'gemini', 'force': False}))
if result.get('stored'): imported += 1
print(f'Imported {imported} memories from Gemini')
"
If no Gemini export exists:
To import Gemini conversations:
- Go to takeout.google.com
- Deselect all, then select Gemini Apps
- Download and unzip to ~/Downloads/
- Run
/cortex-importagain
Phase 6: Consolidation
After all imports:
cortex:consolidate({})
cortex:memory_stats({})
Final Summary
Print one summary block with all results.
Files in this skill
1cortex-import skill questions
How do I install the cortex-import skill in Claude Code?
Run npx degit cdeust/Cortex/skills/cortex-import ~/.claude/skills/cortex-import. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the cortex-import skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How do I import my ChatGPT history into Cortex?
You must export your data from the ChatGPT web interface (Settings → Data controls → Export), unzip the file to your Downloads folder, and then run the import command.
What sources can be migrated to Cortex?
The tool supports Claude Code JSONL, Claude Desktop sessions, claude-mem (SQLite), ChatGPT web exports, Gemini Takeout, and Cursor conversations.
How can I import my Gemini conversations?
Use Google Takeout to select Gemini Apps, download and unzip the data to your Downloads folder, and then run the import process.