Skip to main content

↝ session-migrate

Carry the conversation forward.

PyPI version Python versions MIT license Project website

session-migrate converting a Claude Code session into a native Codex session

Move local coding-agent sessions between Claude Code, Codex, Pi, OpenCode, GitHub Copilot CLI, Antigravity CLI, and Cursor Agent.

Install

uv tool install session-migrate

No uv? Use the standalone installer:

curl -LsSf https://raw.githubusercontent.com/xhluca/session-migrate/main/install.sh | sh

pipx install session-migrate works too. Python 3.11+ and Linux are currently supported. The full command is session-migrate; smigrate is the shorthand. Already installed? Run uv tool upgrade session-migrate.

Quick start

Inspect any native transcript without printing its conversation:

smigrate inspect ~/.claude/projects/-work/SESSION.jsonl

Move a Claude session into Codex and resume it from the same project directory:

smigrate transfer SESSION_UUID --from claude --to codex --cwd "$PWD"
codex resume NEW_SESSION_UUID

Or find an older session by title first:

smigrate catalog refresh
smigrate catalog search "authentication refactor"
smigrate transfer --catalog-id RESULT_ID --to pi

catalog refresh is exhaustive inside the default, environment-selected, registered, and explicitly discovered roots. It does not crawl your whole disk.

Give it to your coding agent

Replace the three bracketed values and paste one sentence:

Follow https://session-migrate.github.io/llms.txt to migrate session [UUID OR TITLE] from [SOURCE] to [TARGET] now.

This exact instruction is sandbox-tested with both Claude Code and Codex. See the agent workflow and verification.

Compatibility

Source ↓ / Target → Claude Codex Pi OpenCode Copilot Antigravity Cursor*
Claude Code ✓ ✓ ✓ ✓ ✓ ✓ T
Codex ✓ ✓ ✓ ✓ ✓ ✓ T
Pi ✓ ✓ ✓ ✓ ✓ ✓ T
OpenCode ✓ ✓ ✓ ✓ ✓ ✓ T
Copilot CLI ✓ ✓ ✓ ✓ ✓ ✓ T
Antigravity CLI ✓ ✓ ✓ ✓ ✓ ✓ T
Cursor Agent* T T T T T T T

✓ means a native portable rewrite. T means ordered user/assistant text only. Cursor support is experimental and pinned to one exact Linux build; it is not a vendor-supported import API. Same-format migration creates a new independent session—it is not a byte-for-byte clone or a live sync.

What survives

  • User and assistant messages, in order, on every route
  • Tool calls/results, supported images, and portable summaries where the target supports them
  • A new native identity, target discovery/picker metadata, and resume state

Anything target-specific is counted in a content-free migration manifest. The source session is never modified. Cursor intentionally accepts text only; private/model-bound thinking is not migrated. See Pi thinking traces.

How it works

native session → validated event timeline → native target → resume

Each reader projects a versioned native transcript into a small ordered model. Each writer then emits only structures verified against the target CLI. This is session migration, not text export: the target receives a discoverable, resumable native session.

More

The Antigravity and Cursor adapters are clean-room, unofficial, and version-pinned. Their independently observed formats are published separately: Antigravity research and Cursor research.

The demo above shows the native Claude conversation before migration, runs the real conversion and inspection commands, then shows the equivalent native Codex history. Conversation playback is accelerated to 2.5×; terminal usage remains at 1×. It uses synthetic, credential-free fixtures. Watch the MP4 or reproduce it.

Compare the native session before and after
Claude Code source Codex target
Claude Code session before migration Codex session after migration
session-migrate project website

Contributing

git clone https://github.com/xhluca/session-migrate.git
cd session-migrate
uv sync --dev
uv run pytest

See the development guide before changing a native adapter. New formats need sanitized fixtures and a real native-resume oracle.

License

MIT

Metadata

Release files for session-migrate 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for session-migrate 0.6.2
File Size Uploaded
session_migrate-0.6.2.tar.gz 296.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for session-migrate 0.6.2
File Interpreter ABI Platform
session_migrate-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 416.4 kB

Release files / session_migrate-0.6.2.tar.gz

Download URL session_migrate-0.6.2.tar.gz
Size 296.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e3c34e29a8e2daf03e0e69a48e2cd2f7ec8644faeda61a13bfe93cac6e9e6f95
BLAKE2b-256 checksum
How to use checksums
78a72e189280d041c4b5e7d9e9f011b99a50d47785738a97c1af5686a92fa38d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / session_migrate-0.6.2-py3-none-any.whl

Download URL session_migrate-0.6.2-py3-none-any.whl
Size 120.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b844bf2fc09caf13b099ce501febf08b735af6a5ac512c6faafa7ad3140eb8e5
BLAKE2b-256 checksum
How to use checksums
55fce3002ff0b271fea6181abba7e72535dde81a97ea6f17bb3e9fb0a7a4ba93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page