Migrate langchain-ai-migrate
Bring a person's local coding-agent setup into Robin with one approval — past Claude Code and Codex conversations become Robin threads, their standing preferences become personal Robin instructions, their skills, slash commands, custom prompts and subagents become personal Robin skills, and remote MCP servers are proposed as their own connections. Read this whenever someone asks to import, migrate or move over their sessions, conversations, history, memories, CLAUDE.md, AGENTS.md, skills, commands, subagents or MCP servers, or sends /migrate.
- Our test
- —
- not tested yet
- GitHub stars
- 11k
- langchain-ai/open-swe
- Added by
- 0
- members
- Updated
- Dec 6
- commit 7972508
- Content
- 1 file
- no scripts · 11 KB
- License
- MIT
- free to use
What our test found
Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.
name: migrate description: Bring a person's local coding-agent setup into Robin with one approval — past Claude Code and Codex conversations become Robin threads, their standing preferences become personal Robin instructions, their skills, slash commands, custom prompts and subagents become personal Robin skills, and remote MCP servers are proposed as their own connections. Read this whenever someone asks to import, migrate or move over their sessions, conversations, history, memories, CLAUDE.md, AGENTS.md, skills, commands, subagents or MCP servers, or sends /migrate.
Migrate to Robin
Everything to migrate lives on the person's machine, so this needs a run on it: a thread started from the Robin desktop app. upload_session and the local file and shell tools are offered only there. If they are not among your tools, tell the person to start a thread from the desktop app and ask again there; do not try to reach their machine another way.
The person approves once. Scan everything without changing anything, show one checklist, and apply only what they approve. Never edit or delete anything on their machine, never overwrite something they already have in Robin, and never print a secret.
1. Scan, changing nothing
- Claude Code sessions:
~/.claude/projects/<project>/<session id>.jsonl. Only files directly in a project folder are sessions; skip anything under asubagents/folder and sessions with no prompt the person typed. - Codex sessions:
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl. The first line issession_meta, whosepayload.idis the session id andpayload.cwdits project. A resumed session writes a new rollout that replays the old one: keep only the newest rollout of each session id. - Memories and instructions:
~/.claude/CLAUDE.mdand the files it imports with@pathlines,~/.claude/projects/*/memory/*.md,~/.codex/AGENTS.md, and any memory files under~/.codex/. A repository's ownCLAUDE.mdorAGENTS.mdstays in the repository, where Robin already reads it. - Skills:
~/.claude/skills/*/and~/.codex/skills/*/: eachSKILL.mdand the files beside it. - Slash commands and custom prompts:
~/.claude/commands/**/*.mdand~/.codex/prompts/*.md. - Subagents:
~/.claude/agents/*.md. - Plugins: skills, commands and subagents of installed Claude Code plugins under
~/.claude/plugins/, grouped under the plugin they came from. - MCP servers:
mcpServersat the top of~/.claude.json(user scope) and under each of itsprojectsentries (local scope), and[mcp_servers.*]in~/.codex/config.toml. These files hold credentials, so never open, print or upload them; take stock only with the script below, which prints each server's name, transport, URL without its query, fragment or user info, whether the URL carried any of those, and the names of its headers. Run it withpython3when it is 3.11 or newer, otherwise withuv run --no-project --python 3.12 python. ```python import json, pathlib, tomllib from urllib.parse import urlsplit
home = pathlib.Path.home()
def show(name, scope, s, headers): p = urlsplit(s.get("url") or "") port = f":{p.port}" if p.port else "" print( json.dumps( { "name": name, "scope": scope, "transport": s.get("type") or ("stdio" if "command" in s else "http"), "url": f"{p.scheme}://{p.hostname}{port}{p.path}" if p.hostname else None, "url_has_secret": bool(p.query or p.fragment or p.username or p.password), "headers": sorted(headers), } ) )
claude = home / ".claude.json" if claude.exists(): data = json.loads(claude.read_text()) scopes = [("user", data.get("mcpServers") or {})] + [ (k, v.get("mcpServers") or {}) for k, v in (data.get("projects") or {}).items() ] for scope, servers in scopes: for name, s in servers.items(): show(name, scope, s, s.get("headers") or {}) codex = home / ".codex" / "config.toml" if codex.exists(): for name, s in (tomllib.loads(codex.read_text()).get("mcp_servers") or {}).items(): show( name, "codex", s, [ (s.get("http_headers") or {}), (s.get("env_http_headers") or {}), *(["Authorization"] if s.get("bearer_token_env_var") else []), ], )
- **Unpushed work:** for each session's working directory that is a git checkout, whether it has uncommitted changes or commits not on its upstream.
- **What they already have in Robin:** their personal skills under `/my-skills/` and the `standing_instructions` in their `person` block, so the checklist shows only what is new.
- **Not migrated:** hooks, permission rules, status lines and other `settings.json` options have no Robin equivalent; note which ones exist.
While scanning, work out what each item becomes (section 3) and check skills, commands, subagents and memory for credentials (API keys, tokens, passwords, private keys, `.env` files); an item that holds one is left out, or kept with the credential removed.
## 2. One checklist, one approval
Send one message: a numbered checklist grouped like this, every item ticked unless noted, then ask the person to reply "go", or "go" with what to change (for example "skip 4 and 9", "all sessions", "linear: oauth").
1. **Sessions:** counts per agent and project; sessions from the last 30 days are ticked, older ones are offered as one unticked line with their count.
1. **Preferences:** each standing preference found, quoted as the line that would be added to their instructions; one-off task details, facts about a particular team and credentials are not offered.
1. **Repository memory:** each note about one repository, ticked to be kept personal as a line starting `In <owner>/<repo>:` (repository from `git -C <dir> remote get-url origin`); say they can instead share it as that repository's Robin instructions (admins only) or in its `AGENTS.md` through a pull request.
1. **Skills, commands and subagents:** each with the Robin skill name it gets and any files it brings.
1. **MCP servers that can be added:** transport `http` with an `https://` URL, by name and URL, each asking how it signs them in: through a browser (`oauth`), with a key in one of its listed headers (`secret`, naming the header), or not at all (`none`).
One whose sign-in they don't answer is skipped.
1. **Unpushed work**, unticked: each checkout with local work, offered to be pushed to a new branch so its imported thread can continue from it.
1. **Left behind**, not selectable, each with its reason: MCP servers started with a local command, legacy `sse` servers, plain `http://` URLs and URLs that carried a secret (offer a managed equivalent from `discover_managed_tools` for a well-known service); hooks and settings; files that are binary, too large or held credentials; items already in Robin.
Change nothing until the person replies.
If the reply is unclear, ask about only the unclear part.
## 3. Apply what they approved
Apply everything approved without asking again, in this order.
- **Unpushed work:** push without touching their checkout, `c=$(git -C <dir> stash create); git -C <dir> push origin "${c:-HEAD}:refs/heads/<branch>"`; untracked files are not included.
- **Sessions:** call `upload_session` once per agent with `type` (`claude` or `codex`) and no `repo`, `branch` or `pr_url`, then run the one loop its `next_step` gives over every approved transcript of that type, on the machine.
Never print an `upload_token`.
Imports are private; pass `visibility="workspace"` only if the person asks.
A session already imported is skipped, so a rerun adds only what is missing.
A 422 means the file held no conversation.
If the token expires partway, call `upload_session` again and rerun the loop; retry other failures once.
- **Preferences and personal repository notes:** `save_user_instructions` replaces their instructions whole, so save their current `standing_instructions` with the approved lines added, skipping lines already there.
- **Repository instructions**, if they chose to share a note there: read the current text with `read_settings` (`resource="repository_instructions"`), add the approved lines and write the whole result with `patch_settings`; if the read fails, write nothing.
- **Skills, commands and subagents:** save each with `save_user_skill`.
Names are lowercase letters, digits and single hyphens, up to 64 characters; descriptions up to 1,024 and instructions up to 100,000 characters.
If the name is taken by a different personal skill, prefix it with `claude-` or `codex-`; never replace one.
- **Skills:** keep the name, description and instructions, and pass the text files beside `SKILL.md` as `files`, keyed by their path inside the skill's folder; runs read them at `/my-skills/<name>/<path>`.
A skill keeps up to 50 files of up to 100,000 characters each.
- **Slash commands and custom prompts:** name the skill after the file's path under `commands/` or `prompts/`, with folders joined by hyphens; use the frontmatter `description`, or a sentence summarizing the body; the body becomes the instructions, with `$ARGUMENTS`, `$1` and similar placeholders described as the person's request.
The person can still run it by typing `/<skill name>` in a Robin message.
- **Subagents:** keep the frontmatter `name` and `description`; the body, the subagent's system prompt, becomes the instructions; its `tools` and `model` settings do not carry over.
- **MCP servers:** call `add_managed_tools_server` for each approved one with its URL exactly as listed and the sign-in they chose (`header` set to the named header for `secret`).
Each still shows its own card for the person to confirm, and they enter any key on LangSmith's page; never ask for or pass a key.
## 4. Report
Say what was imported and what failed: sessions per agent, preferences added, where repository notes went, skills saved and their names, MCP servers proposed, branches pushed and whose work each holds, and what was left behind and why.
List every skill and instruction line this import added, so the import can be undone if the person asks.
To undo, delete those skills with `delete_user_skill`, then take their current `standing_instructions`, remove only the lines this import added that are still there unchanged, and save the rest with `save_user_instructions`; keep every other line, including edits made since the import and added lines they have since changed.
Say the imported threads are in the sidebar.