claude-code-migration

A guided tool for copying Claude Code settings and project configuration into sid-code. It checks what can be moved, asks before writing, and records what was transferred.

In plain words
What is it for?
Use it to migrate Claude Code settings, MCP servers, commands, skills, agents, hooks, memory, output styles, and permissions to sid-code.
Why use it?
It helps avoid losing settings or overwriting existing sid-code files when changing coding tools. It also keeps secrets, login data, and unsupported files out of the migration.

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/rushengzhou/sid-code/claude-code-migration
Any agent
npx skills add rushengzhou/sid-code --skill claude-code-migration
Clone the repo
git clone --depth 1 https://github.com/rushengzhou/sid-code

Made for: Claude Code, Codex.

Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,106 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00100 $0.04106
Opus 5 $0.00050 $0.02053
Sonnet 5 $0.00020 $0.00821
Haiku 4.5 $0.00010 $0.00411

Measured yesterday against content hash 2819ea7e12de, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

claude-code-migration scanned grade A with 0 findings 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 yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/apply-migration.mjs, scripts/inspect-migration.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/core/src/skill/builtin/claude-code-migration/SKILL.md · 147 lines

How it starts

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

Claude Code 到 sid-code 迁移

只用于 Claude Code -> sid-code。首要目标是保护用户现有环境:只 copy,不 move;不删除源文件;不静默覆盖目标文件。

不可违反的规则

  • 先做只读检查。 展示迁移计划前,不写文件、不运行安装命令。
  • 默认使用用户启动 sid-code 的当前目录作为项目上下文。如果 ~/.claude.json 里有多个项目条目匹配,先让用户选择。
  • 所有写入前都要用户确认。 高风险资源单独确认:permissions、hooks、MCP secrets/env/headers、env 字段,以及所有冲突。
  • 迁移计划和确认问题必须按 scope 拆开说明:用户级、项目共享级、项目本地级分别迁移哪些、跳过哪些、写到哪里。
  • 不迁移 auth state、OAuth/session 文件、managed/policy settings、trust caches 或未知 state/cache 文件。
  • 只写入 references/mapping.md 列出的目标文件;不要创建未列出的 sid-code 配置文件。
  • 允许写入迁移状态文件 ~/.sid-code/state/cc-migration-state.json(inspector 的默认 --state 路径)。它是本 skill 的记账文件,不是 sid-code 运行时配置;只记录已迁移项的标识(scope、目标路径或 目标#mcpServers.name、时间戳、项目路径),绝不写入 secret / env / headers 值。绝不触碰 ~/.sid-code/state/migrations.json——那是 sid-code 内核 schema 迁移的版本水位线文件。
  • 未知、不支持、无效和空字段默认只报告;除非 references/mapping.md 明确写了迁移方式。
  • 无论是否实际写入,最后都要生成迁移报告。

写入 settings.json 的硬性约束

绝不整体覆盖写 sid-code 的 settings.json。 只做「新增缺失的顶层字段/嵌套键」的 patch 式合并:读入现有 JSON → 只添加计划里确认的字段 → 写回。原因:sid-code 的 settings 经 Zod round-trip 整体重写会 strip 掉嵌套字段(如 availableModels[].apiKey)并把 ${ENV} 占位符展开成明文落盘。若目标字段已存在,走冲突流程,不覆盖。

JSON 合并的硬性约束(settings.json / .mcp.json)

绝不即兴写临时脚本(如 /tmp/*.mjs/tmp/*.js)来做 JSON 合并。 这类做法反复出问题:临时脚本用错模块系统(.mjs 里写 require 直接崩)、或改走 write 工具把整段 JSON 当字符串塞进去被参数校验拒绝。JSON 的 patch 合并、type→transport 转换等确定性变换一律交给 skill 自带的确定性脚本,你只负责调用它、传参、读它的 JSON 结果:

# settings.json patch 合并(只新增缺失键,冲突默认跳过并报告,不覆盖已有键与嵌套 apiKey)
node <skill-dir>/scripts/apply-migration.mjs --op merge-settings --target <settings.json> --patch '<json>'
# MCP 合并(自动做 type→transport、disabled→enabled、丢弃不支持字段;已存在的 server 名算冲突跳过)
node <skill-dir>/scripts/apply-migration.mjs --op merge-mcp --target <.mcp.json 或 settings.json> --servers '<json>'
  • patch/servers 过长时改用 --patch-file <path> / --servers-file <path> 从文件读,避免超长命令行。
  • 想先看结果不落盘:加 --dry-run,脚本会把合并后的完整对象放在返回 JSON 的 result 字段里。
  • 需要覆盖已有键时(仅在用户明确选择"覆盖"冲突处理方式后):加 --on-conflict overwrite
  • 脚本返回 JSON:{ ok, written, added:[], conflicts:[], transforms:[] }。据 conflicts 走冲突确认流程,据 transforms 向用户交代做了哪些转换。
  • 与 inspector 一样,脚本用 nodebun 都能跑(见下方运行时探测)。

Read the full file on GitHub · 147 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 147 lines · 100 tokens per session scan A 2819ea7e12de

Subscribe to this mod's changes

claude-code-migration is a skill published in the GitHub repository rushengzhou/sid-code (2 stars, last pushed 2d ago), licensed MIT. It adds 100 tokens to every session and 4,106 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

omd-contract

把审议结论结晶成正式契约文档落盘 docs/plan/,当 /omd-execute 的执行契约。承接 /omd-grill 的决策记录表,写给没有对话上下文的执行器看。含 crystallize/crystals 职能。Trigger:/omd-contract、定契约、写成执行契约、写成 SDD、SDD、结晶、方案定了记下来、列结晶。.

AbyssCN/oh-my-dag · 105 tokens

omd-grill

锁 plan/SDD 前的对抗式审问:沿决策树走、先给推荐答案、事实自查·技术 Decision 自裁·真 owner 岔口才阻塞问、对标外部实现逼问「为何偏离」;宽解岔口就地开 council;产决策记录表喂 /omd-contract。审议纪律:只讨论不动手。Trigger:/omd-grill、审问、盘问这个方案、把这事讨论清楚、压测计划、stress-test。.

AbyssCN/oh-my-dag · 122 tokens

omd-video

视频→逐段结构化笔记 (MiMo-v2.5 原生吃画面+音频, 非 whisper 转写; 可重入管线)。讲解/课程视频里 PPT 框架图/代码/提示词是画面独有、音频拿不到的信息。产 ALL-NOTES.md 交 /omd-council 或 dagresearch 做综合。Trigger:/omd-video、抖音/B站/YouTube 讲解视频、课程系列、把这些视频学一遍/提炼、画面里有代码/图表/PPT。Skip:文字原文综合→/omd-council;网页内容→dagresearch(检索版)。.

AbyssCN/oh-my-dag · 155 tokens

omd-docs-drift

文档漂移追踪:确定性死路径/死锚闸(bun test 常驻)之外的语义半——按 docs/docs-map.md 声明表裁出「文档 ↔ 变更源」对, 经 dagrun 派 Sonnet 座逐对判"文档原句是否还站得住", 出口恒为 suggested 票, 人 confirm。Trigger:/omd-docs-drift、查文档漂移、文档跟没跟上代码、docs drift。.

AbyssCN/oh-my-dag · 119 tokens

omd-audit

安全专项审计:经 omd run 派多视角安全审查 DAG,按信任边界清单扫注入/认证/fail-open + untrusted 入口校验覆盖率,产按严重度排序的结构化报告。Trigger:/omd-audit、安全审计、查漏洞、信任边界、security review。.

AbyssCN/oh-my-dag · 80 tokens

omd-research-deep

终极档深度调研:种子作者化多角度抓取 + council 分解 + 多轮缺口补挖,一条工具调用出整领域 grounded 报告。Trigger:/omd-research-deep、深度调研、deep research、整领域调研、调研到 grounded 底座、把这个领域研究透。Skip:轻量单点查证(tavily 直查)/ 单问题综合(dagresearch 默认档)/ 代码理解(dag-map)。.

AbyssCN/oh-my-dag · 117 tokens