Claude 全生态一键迁移入口 — 编排 chat-migration / cowork-migration / hermes-migration / neudrive-sync 四个子 skill 完成从 Claude.ai Chat + Cowork + Claude Code 到任意目标 Agent 的完整迁移。 当用户说"全量迁移"、"完整迁移"、"claude full migration"、"一键搬家"、"全家桶迁移"、"full migration"时触发。
Meta-skill:把下面 4 个独立 skill 按正确顺序编排成一次完整的迁移,避免用户手工组合。
/claude-full-migration
├── /chat-migration (可选)
├── /cowork-migration (可选)
├── /hermes-migration (可选)
└── /neudrive-sync (可选,作为汇总)
.full-migration-audit.json依次自检的前置数据:
code.claude.com/docs/llms.txt — Claude Code 文档(for hermes-migration)support.claude.com/en/articles/9450526-how-can-i-export-my-claude-data — 官方导出流程(for chat-migration)github.com/agi-bar/neuDrive/blob/main/docs/sync.md — neuDrive 同步协议(for neudrive-sync)github.com/osteele/claude-chat-viewer/blob/main/src/schemas/chat.ts — Claude.ai 导出 schema(for chat-migration)对每份文档抽取关键数据结构,对比本 skill 的子 skill 映射表。若任一子 skill 的映射过期:
合并 4 个子 skill 的依赖到一张表:
echo "=== 全量迁移环境检查 ==="
# 通用依赖
for cmd in python3 unzip curl git; do
command -v $cmd &>/dev/null && echo "✅ $cmd" || echo "❌ $cmd 缺失"
done
PY_VER=$(python3 --version 2>&1 | awk '{print $2}')
PY_MINOR=$(echo $PY_VER | cut -d. -f2)
[ "$PY_MINOR" -ge 11 ] && echo "✅ Python $PY_VER (>= 3.11)" || echo "⚠️ Python $PY_VER (hermes-migration 需要 >= 3.11)"
# 子 skill 是否就位
for skill in hermes-migration chat-migration cowork-migration neudrive-sync; do
[ -f ~/.claude/skills/$skill/SKILL.md ] && echo "✅ /$skill 就位" || echo "❌ /$skill 未安装"
done
# 目标侧依赖
command -v hermes &>/dev/null && echo "✅ Hermes Agent" || echo "⚪ Hermes Agent 未装 (hermes-migration 会引导)"
command -v neu &>/dev/null && echo "✅ neu CLI" || echo "⚪ neu CLI 未装 (neudrive-sync 会引导)"
python3 -c "import neudrive" 2>/dev/null && echo "✅ neudrive Python SDK" || echo "⚪ neudrive SDK 未装"
自动发现用户手上有什么数据:
import os, glob
discovery = {
'claude_code': False, # ~/.claude/ 存在且有内容
'chat_zip': None, # 用户声明的导出 ZIP 路径
'cowork_zip': None, # 团队导出 ZIP
'previous_migration': [] # 之前有没有跑过子 skill 的输出
}
# Claude Code
cc_home = os.path.expanduser('~/.claude')
if os.path.isdir(cc_home):
projects = glob.glob(f"{cc_home}/projects/*")
discovery['claude_code'] = {
'home': cc_home,
'projects': len(projects),
'size': sum(os.path.getsize(f) for f in glob.glob(f"{cc_home}/**", recursive=True) if os.path.isfile(f)) // (1024*1024)
}
# 历史迁移产物
for pattern in ['/tmp/chat-migration-*', '/tmp/cowork-migration-*', '/tmp/hermes-migration-*']:
hits = glob.glob(pattern)
if hits:
discovery['previous_migration'].extend(hits)
print(f"发现:")
print(f" Claude Code: {discovery['claude_code']}")
print(f" 之前迁移输出: {len(discovery['previous_migration'])} 个")
再用 AskUserQuestion 补充确认:
/tmp/*-migration-* 时问是否续用)用 AskUserQuestion (multi-select) 让用户选目标:
| 目标 | 说明 | 需要的子 skill |
|---|---|---|
| Hermes Agent 直迁 | 本机跑的 Hermes,最省心 | hermes-migration |
| 本地 Markdown 归档 | 纯文本备份,Obsidian/文件系统可读 | chat-migration, cowork-migration |
| neuDrive Hub | 多 Agent 共享枢纽(推荐) | neudrive-sync + 任意源 |
| SQLite FTS5 | 给 Hermes --resume 用 | chat-migration 或 hermes-migration |
| Cursor / Codex / Kimi | 通过 neuDrive MCP 间接接入 | neudrive-sync |
用户选完之后,本 skill 根据"源 × 目标"矩阵自动规划执行清单。
向用户展示即将执行的 skill 调用顺序:
📋 执行计划预览
步骤 1: /chat-migration
输入: ~/Downloads/claude-export-2026-04.zip
输出: /tmp/chat-migration-<ts>/output/
包含: Markdown, SQLite FTS5
步骤 2: /hermes-migration
扫描: ~/.claude/ (47 种数据)
输出: ~/.hermes/ (你选的 Hermes 直迁目标)
步骤 3: /neudrive-sync
实例: https://www.neudrive.ai
源: 上面两步的输出 + ~/.claude/ 直接扫
模式: Hybrid (让 neuDrive 自扫 + 补差集)
步骤 4: 生成汇总审计 .full-migration-audit.json
预计耗时: 10-30 分钟(取决于聊天记录大小)
是否确认执行?(Y/N/修改)
如果用户选 N → 展示如何手工调单个 skill。 如果用户选"修改" → 回到 Phase 3 重选。
调用 Skill tool 依次运行(每步失败可重试或跳过):
5.1 Chat (if selected)
Skill: chat-migration