Skip to main content

session-migrate

Migrate your sessions to any harness.

PyPI version Python versions MIT license Project website

A Claude Code session migrated and continued inside the native Pi TUI

Move coding agent sessions among Claude Code, Codex, Pi, OpenCode, GitHub Copilot CLI, Antigravity CLI, Cursor Agent, Mistral Vibe, Muse Code, Qwen Code, and Kimi Code.

Install

curl -LsSf https://session-migrate.github.io/install.sh | sh

Or install with uv:

uv tool install session-migrate

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 its native title/name first:

smigrate catalog refresh
smigrate catalog search "oauth refresh" --format claude
smigrate transfer --title "oauth refresh" --from claude --to pi

Search is case-insensitive and every word must match, in any order. It searches native titles, names, and IDs—not conversation bodies. A few useful patterns:

# “Fix flaky PostgreSQL timeout” also matches this reversed keyword order.
smigrate catalog search "timeout postgres"

# Find a release conversation among archived Codex sessions from this month.
smigrate catalog search "release notes" --format codex \
  --lifecycle archived --since 2026-08-01T00:00:00Z

# Opt in to matching a project directory when the title is vague.
smigrate catalog search "checkout api" --include-paths

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

Choose the route on the project website, or replace the three bracketed values yourself:

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

The linked procedure is sandbox-tested with both Claude Code and Codex. See the agent workflow and verification.

Compatibility

  • Claude Code
  • Codex CLI
  • Pi
  • OpenCode
  • GitHub Copilot CLI
  • Antigravity CLI
  • Mistral Vibe
  • Muse Code
  • Qwen Code
  • Kimi Code
  • Cursor Agent (experimental, pinned, text only)

Every listed format can be a source or target: 121 ordered routes, including same-format portable rewrites. Cursor deliberately transfers only ordered user/assistant text and is 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

Session data Result Notes
User and assistant messages ✓ Preserved in order on every route
Tool calls and results ✓ / partial Preserved when both adapters support the native shape
Images ✓ / partial Supported image blocks move; other media is format-dependent
Compaction summaries ✓ / partial Recreated where the target has a portable equivalent
Readable reasoning Vibe-only portable rewrite Vibe keeps its explicit readable field when rewritten to Vibe; other/private/signed traces never move
Session name, ID, and picker entry Recreated The target gets a new native identity and resume state
Branches, forks, and subagents Not flattened Cataloged separately where detectable; migrate the parent session
Private or signed thinking No Model/provider-bound traces are deliberately omitted
Auth, hooks, policies, MCP, and runtime config No These remain with the source client

Every omission or transformation is counted in a content-free migration manifest. The source session is never modified. Cursor intentionally accepts text only. 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 uses real native casts recorded with the same tmux + asciinema approach as agent-talk. Claude diagnoses a boundary bug in a small project; the migrated session is reopened in Pi, which applies the proposed patch and runs the regression test. It shows the source TUI, the migration command, the shared history, and the continued target session. The website plays those casts directly in JavaScript; the README animation is rendered from that same scene. The same source session is also continued in Claude → Codex. Watch the larger-text Pi video, watch the larger-text Codex video, or reproduce both. The recorder uses disposable credential copies only to drive the native clients; the published assets contain only the controlled demo project and omit account status.

Compare Claude Code → Pi inside the native clients
Before · Claude Code TUI After · Pi TUI
Claude Code native session before migration Migrated session continued inside the native Pi TUI
Compare Claude Code → Codex inside the native clients
Before · Claude Code TUI After · Codex TUI
Claude Code native session before migration Migrated session continued inside the native Codex TUI
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.8.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.8.0
File Size Uploaded
session_migrate-0.8.0.tar.gz 358.6 kB Details

Built distribution (wheel)

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

Total release size: 509.9 kB

Release files / session_migrate-0.8.0.tar.gz

Download URL session_migrate-0.8.0.tar.gz
Size 358.6 kB
Tags Source
SHA-256 checksum
How to use checksums
509b250e021faeb0a705e393b9430b60e50fcc6450baadf223f8114bdc0d1350
BLAKE2b-256 checksum
How to use checksums
a336e8434c02dc5953a1a9263b7cd3856a760899889de3a97c7642ff2a7e9b92
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.8.0-py3-none-any.whl

Download URL session_migrate-0.8.0-py3-none-any.whl
Size 151.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41b06b15565287fc772a9a5772c2018cae69675bf8ce67c28c292b3ee27bc0c6
BLAKE2b-256 checksum
How to use checksums
3dbd9cb77a8274c3e84f80c783c7c8e59e900c673965306df32ee4c51fbeb6fa
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

This release

0.8.0 This release

2 release files

0.7.1

2 release files

0.6.2

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