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 on 0.5.x? 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.

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.0

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.0
File Size Uploaded
session_migrate-0.6.0.tar.gz 702.6 kB Details

Built distribution (wheel)

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

Total release size: 822.8 kB

Release files / session_migrate-0.6.0.tar.gz

Download URL session_migrate-0.6.0.tar.gz
Size 702.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ff6526be9a3cb813ee8bb6ef5db22a3c7c8774617acdea61b84b98744b56249a
BLAKE2b-256 checksum
How to use checksums
4f1560ff30519ad2e9e0a9a5542d381d409fe5347c1f056fd3682436fa8dd3c1
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.0-py3-none-any.whl

Download URL session_migrate-0.6.0-py3-none-any.whl
Size 120.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bf0459637a29cb7dae88a286d1de46f6110881637bbd373ca9dd4d256da01a1
BLAKE2b-256 checksum
How to use checksums
2459f632ea50c793fd2341574248b78612d8f50d23df8f33b8696511b6734cb1
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

0.6.2

2 release files

0.6.1

2 release files

This release

0.6.0 This release

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