session-migrate 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- session_migrate-0.5.1/.gitignore +14 -0
- session_migrate-0.5.1/.python-version +2 -0
- session_migrate-0.5.1/CHANGELOG.md +118 -0
- session_migrate-0.5.1/LICENSE +21 -0
- session_migrate-0.5.1/PKG-INFO +152 -0
- session_migrate-0.5.1/README.md +127 -0
- session_migrate-0.5.1/docs/additional-target-formats.md +422 -0
- session_migrate-0.5.1/docs/architecture.md +246 -0
- session_migrate-0.5.1/docs/cli-reference.md +350 -0
- session_migrate-0.5.1/docs/copilot-antigravity-targets.md +260 -0
- session_migrate-0.5.1/docs/development.md +181 -0
- session_migrate-0.5.1/docs/docker-environment.md +252 -0
- session_migrate-0.5.1/docs/exploration-log.md +474 -0
- session_migrate-0.5.1/docs/format-compatibility.md +303 -0
- session_migrate-0.5.1/docs/pi-thinking-traces.md +145 -0
- session_migrate-0.5.1/docs/session-catalog.md +201 -0
- session_migrate-0.5.1/docs/specification.md +183 -0
- session_migrate-0.5.1/docs/troubleshooting.md +301 -0
- session_migrate-0.5.1/docs/validation-report.md +772 -0
- session_migrate-0.5.1/install.sh +52 -0
- session_migrate-0.5.1/pyproject.toml +64 -0
- session_migrate-0.5.1/scripts/demo-trajectory.sh +66 -0
- session_migrate-0.5.1/scripts/render-demo.sh +49 -0
- session_migrate-0.5.1/scripts/validate-additional-target-corpus.py +1667 -0
- session_migrate-0.5.1/scripts/validate-authenticated-pi-tui.py +314 -0
- session_migrate-0.5.1/scripts/validate-copilot-native.py +482 -0
- session_migrate-0.5.1/scripts/validate-core-target-native.py +335 -0
- session_migrate-0.5.1/scripts/verify-native-resume.sh +97 -0
- session_migrate-0.5.1/src/session_migrate/__init__.py +3 -0
- session_migrate-0.5.1/src/session_migrate/__main__.py +3 -0
- session_migrate-0.5.1/src/session_migrate/catalog.py +1564 -0
- session_migrate-0.5.1/src/session_migrate/cli.py +556 -0
- session_migrate-0.5.1/src/session_migrate/conversion.py +833 -0
- session_migrate-0.5.1/src/session_migrate/discovery.py +76 -0
- session_migrate-0.5.1/src/session_migrate/errors.py +13 -0
- session_migrate-0.5.1/src/session_migrate/formats/__init__.py +5 -0
- session_migrate-0.5.1/src/session_migrate/formats/claude.py +680 -0
- session_migrate-0.5.1/src/session_migrate/formats/codex.py +629 -0
- session_migrate-0.5.1/src/session_migrate/formats/common.py +114 -0
- session_migrate-0.5.1/src/session_migrate/formats/copilot.py +888 -0
- session_migrate-0.5.1/src/session_migrate/formats/opencode.py +786 -0
- session_migrate-0.5.1/src/session_migrate/formats/pi.py +851 -0
- session_migrate-0.5.1/src/session_migrate/inspection.py +252 -0
- session_migrate-0.5.1/src/session_migrate/jsonl.py +227 -0
- session_migrate-0.5.1/src/session_migrate/model.py +83 -0
- session_migrate-0.5.1/tests/fixtures/claude-2.1.209/basic.jsonl +9 -0
- session_migrate-0.5.1/tests/fixtures/codex-0.144.4/basic.jsonl +12 -0
- session_migrate-0.5.1/tests/fixtures/opencode-1.17.20/basic.json +110 -0
- session_migrate-0.5.1/tests/fixtures/pi-0.80.6/basic.jsonl +6 -0
- session_migrate-0.5.1/tests/test_additional_formats.py +770 -0
- session_migrate-0.5.1/tests/test_additional_formats_native.py +648 -0
- session_migrate-0.5.1/tests/test_catalog.py +649 -0
- session_migrate-0.5.1/tests/test_cli.py +396 -0
- session_migrate-0.5.1/tests/test_conversion.py +1358 -0
- session_migrate-0.5.1/tests/test_copilot_format.py +338 -0
- session_migrate-0.5.1/tests/test_discovery.py +73 -0
- session_migrate-0.5.1/tests/test_inspection.py +220 -0
- session_migrate-0.5.1/tests/test_jsonl.py +101 -0
- session_migrate-0.5.1/tests/test_target_integration.py +791 -0
- session_migrate-0.5.1/uv.lock +108 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `session-migrate` are recorded
|
|
4
|
+
here. Native format compatibility is documented separately in
|
|
5
|
+
[`docs/format-compatibility.md`](docs/format-compatibility.md).
|
|
6
|
+
|
|
7
|
+
## Unreleased
|
|
8
|
+
|
|
9
|
+
## 0.5.1 - 2026-08-20
|
|
10
|
+
|
|
11
|
+
- Publish `session-migrate` to PyPI with MIT licensing, complete package
|
|
12
|
+
metadata, and verified `uv tool install` and `pipx` entry points.
|
|
13
|
+
- Replace the research-heavy README with a concise open-source overview,
|
|
14
|
+
animated real-CLI demo, practical examples, and a compact compatibility map.
|
|
15
|
+
- Add a standalone one-line shell installer with isolated-venv fallback and
|
|
16
|
+
no-clobber handling for pre-existing command files.
|
|
17
|
+
- Add and deploy a responsive landing page with an animated migration pipeline,
|
|
18
|
+
real trajectory video, social card, copyable installs, and native-target
|
|
19
|
+
matrix.
|
|
20
|
+
|
|
21
|
+
## 0.5.0 - 2026-08-19
|
|
22
|
+
|
|
23
|
+
- Rename the project, Python distribution, import package, executable, state
|
|
24
|
+
directory, environment variables, generated metadata, and documentation to
|
|
25
|
+
`session-migrate`; add the collision-checked `smigrate` executable alias.
|
|
26
|
+
- Make the rename intentionally breaking: no legacy executable, import,
|
|
27
|
+
manifest path, state lookup, or compatibility shim remains. Manifests now
|
|
28
|
+
use schema version 2 and the `migration_version` key.
|
|
29
|
+
- Prepare the repository for public access with a complete current-tree and
|
|
30
|
+
reachable-history credential/content audit.
|
|
31
|
+
- Document how Pi 0.80.6 separates thinking-level configuration, visible
|
|
32
|
+
reasoning summaries, and opaque same-provider replay signatures, with
|
|
33
|
+
synthetic transformation and real-store offline-RPC evidence. The migrator
|
|
34
|
+
continues to count rather than transfer private reasoning.
|
|
35
|
+
|
|
36
|
+
## 0.4.0 - 2026-08-18
|
|
37
|
+
|
|
38
|
+
- Promote Pi 0.80.6 v3 to a first-class detectable source with active-tree
|
|
39
|
+
parsing, UUID/CWD discovery, direct transfer, catalog indexing/search, and
|
|
40
|
+
exact conversion into Claude, Codex, OpenCode, and Copilot.
|
|
41
|
+
- Generalize the bounded real-session matrix to Claude, Codex, and Pi sources
|
|
42
|
+
and every different supported target; preserve same-format rejection and the
|
|
43
|
+
Antigravity/Cursor fail-closed capability boundary.
|
|
44
|
+
- Add real-source pinned native Claude/Codex resume oracles, generalized Pi and
|
|
45
|
+
OpenCode native checks, and Codex/Pi-to-Copilot cold-resume/provider replay.
|
|
46
|
+
- Add a disposable actual Pi TUI trajectory that translates existing Codex
|
|
47
|
+
OAuth only inside a private temporary home, completes two live turns, checks
|
|
48
|
+
context recall and append-only persistence, and removes copied credentials.
|
|
49
|
+
- Fix Unicode JSON line-separator handling, bounded exhaustive-audit memory,
|
|
50
|
+
OpenCode tool-result association accounting, Copilot source-text grouping,
|
|
51
|
+
Copilot excess-result native linkage, and silent Pi nested tool-result and
|
|
52
|
+
parent-lineage omissions.
|
|
53
|
+
|
|
54
|
+
## 0.3.0 - 2026-08-18
|
|
55
|
+
|
|
56
|
+
- Add GitHub Copilot CLI 1.0.70 conversion/import using its public local event
|
|
57
|
+
schema, content-addressed images, exact UUID resume, and derived-index rebuild.
|
|
58
|
+
- Keep Antigravity CLI 1.1.14 explicitly fail closed after proving that its
|
|
59
|
+
public CLI/SDK has no arbitrary transcript import despite successful actual
|
|
60
|
+
two-turn TUI/runtime checks.
|
|
61
|
+
- Add exhaustive 102-session Copilot conversion/reparse/loss validation,
|
|
62
|
+
10-session native cold-resume/provider-replay validation, and actual
|
|
63
|
+
two-turn loopback plus authenticated Copilot TUI checks.
|
|
64
|
+
- Document the credential boundary: use target-supported login or BYOK only;
|
|
65
|
+
never copy or reinterpret Codex OAuth as GitHub/Google/OpenAI credentials.
|
|
66
|
+
|
|
67
|
+
## 0.2.0 - 2026-08-18
|
|
68
|
+
|
|
69
|
+
- Add a private, incremental, multi-root Claude/Codex session catalog with
|
|
70
|
+
metadata-only title/name and UUID search.
|
|
71
|
+
- Inventory Claude nested sidechains, Codex active/archive rollouts,
|
|
72
|
+
duplicates, missing/corrupt files, and known unsupported history modes
|
|
73
|
+
without misrepresenting them as convertible.
|
|
74
|
+
- Add bounded project-local root discovery, persistent explicit roots, and
|
|
75
|
+
exact `transfer --catalog-id` selection.
|
|
76
|
+
- Add native Pi 0.80.6 conversion/import and OpenCode 1.17.20 public-bundle
|
|
77
|
+
conversion plus official-CLI import. Keep Cursor import explicitly
|
|
78
|
+
unsupported until it exposes a supported import contract.
|
|
79
|
+
- Add a separate target-format model and explicit `transfer --to`, while
|
|
80
|
+
preserving legacy Claude-to-Codex and Codex-to-Claude defaults.
|
|
81
|
+
- Harden portable image validation, OpenCode native ID/time ordering,
|
|
82
|
+
empty-history rejection, target collision handling, private temporary files,
|
|
83
|
+
and content-free post-import manifests.
|
|
84
|
+
- Pass exhaustive 102-session Claude-to-Pi and Claude-to-OpenCode semantic and
|
|
85
|
+
loss-accounting validation, 20-session actual-content review per target, and
|
|
86
|
+
isolated native smoke tests on 10 real conversions per target.
|
|
87
|
+
|
|
88
|
+
## 0.1.2 - 2026-08-18
|
|
89
|
+
|
|
90
|
+
- Added complete CLI, troubleshooting, and development/release documentation.
|
|
91
|
+
- Clarified sensitive-data handling, manifest semantics, evidence provenance,
|
|
92
|
+
Docker reproducibility, and the v0.1.x support boundary.
|
|
93
|
+
- Count non-object and malformed known image/reference blocks in structured
|
|
94
|
+
tool results instead of silently skipping them, in both conversion
|
|
95
|
+
directions.
|
|
96
|
+
- Expand quoted `~` consistently in CLI paths and report the actual converted
|
|
97
|
+
output/manifest locations.
|
|
98
|
+
- Passed 58 tests, the official two-way pinned native-resume probe, package
|
|
99
|
+
builds, isolated-wheel installation, and a focused 56,758-rollout structured
|
|
100
|
+
output audit.
|
|
101
|
+
|
|
102
|
+
## 0.1.1 - 2026-08-18
|
|
103
|
+
|
|
104
|
+
- Completed exhaustive supported-corpus semantic validation and a 60-session
|
|
105
|
+
content-level manual audit.
|
|
106
|
+
- Added retained-record warnings for orphan and duplicate tool linkage.
|
|
107
|
+
- Added duplicate-call/result regression coverage in both directions.
|
|
108
|
+
- Published the sanitized thorough-validation report and pinned native-resume
|
|
109
|
+
evidence.
|
|
110
|
+
|
|
111
|
+
## 0.1.0 - 2026-08-18
|
|
112
|
+
|
|
113
|
+
- Released the bidirectional Claude Code/Codex CLI conversion baseline.
|
|
114
|
+
- Added `inspect`, `convert`, `import`, and UUID-based `transfer` workflows.
|
|
115
|
+
- Added bounded parsing, content-free manifests, atomic no-clobber private
|
|
116
|
+
writes, changing-source detection, and direct native discovery.
|
|
117
|
+
- Validated explicit native resume against Claude Code 2.1.209 and Codex CLI
|
|
118
|
+
0.144.4 in the pinned Docker image.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xhluca
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: session-migrate
|
|
3
|
+
Version: 0.5.1
|
|
4
|
+
Summary: Convert Claude, Codex, and Pi sessions to supported native agent targets
|
|
5
|
+
Project-URL: Homepage, https://session-migrate.team-reddy-mila.chatgpt.site
|
|
6
|
+
Project-URL: Repository, https://github.com/xhluca/session-migrate
|
|
7
|
+
Project-URL: Documentation, https://github.com/xhluca/session-migrate/tree/main/docs
|
|
8
|
+
Project-URL: Issues, https://github.com/xhluca/session-migrate/issues
|
|
9
|
+
Author: xhluca
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: claude,codex,copilot,opencode,pi,session-migration
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
<h1 align="center"><a href="https://session-migrate.team-reddy-mila.chatgpt.site">↝ session-migrate</a></h1>
|
|
27
|
+
|
|
28
|
+
<p align="center"><strong>Carry the conversation forward.</strong></p>
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<a href="https://pypi.org/project/session-migrate/"><img src="https://img.shields.io/pypi/v/session-migrate?style=flat-square&color=b8f94a&label=PyPI" alt="PyPI version"></a>
|
|
32
|
+
<a href="https://pypi.org/project/session-migrate/"><img src="https://img.shields.io/pypi/pyversions/session-migrate?style=flat-square" alt="Python versions"></a>
|
|
33
|
+
<a href="https://github.com/xhluca/session-migrate/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-8dbdff?style=flat-square" alt="MIT license"></a>
|
|
34
|
+
<a href="https://session-migrate.team-reddy-mila.chatgpt.site"><img src="https://img.shields.io/badge/website-live-b8f94a?style=flat-square" alt="Project website"></a>
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<img src="https://raw.githubusercontent.com/xhluca/session-migrate/main/docs/assets/demo.gif" alt="session-migrate converting a Claude Code session into a native Codex session" width="860">
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
Move local coding-agent sessions between <strong>Claude Code</strong>,
|
|
43
|
+
<strong>Codex</strong>, <strong>Pi</strong>, <strong>OpenCode</strong>, and
|
|
44
|
+
<strong>GitHub Copilot CLI</strong>.
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
## Install
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
uv tool install session-migrate
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
No `uv`? Use the standalone installer:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
curl -LsSf https://raw.githubusercontent.com/xhluca/session-migrate/main/install.sh | sh
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`pipx install session-migrate` works too. Python 3.11+ and Linux are currently
|
|
60
|
+
supported. The full command is `session-migrate`; `smigrate` is the shorthand.
|
|
61
|
+
|
|
62
|
+
## Quick start
|
|
63
|
+
|
|
64
|
+
Inspect any native transcript without printing its conversation:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
smigrate inspect ~/.claude/projects/-work/SESSION.jsonl
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Move a Claude session into Codex and resume it from the same project directory:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
smigrate transfer SESSION_UUID --from claude --to codex --cwd "$PWD"
|
|
74
|
+
codex resume NEW_SESSION_UUID
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Or find an older session by title first:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
smigrate catalog refresh
|
|
81
|
+
smigrate catalog search "authentication refactor"
|
|
82
|
+
smigrate transfer --catalog-id RESULT_ID --to pi
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Compatibility
|
|
86
|
+
|
|
87
|
+
| Source ↓ / Target → | Claude | Codex | Pi | OpenCode | Copilot |
|
|
88
|
+
| --- | :---: | :---: | :---: | :---: | :---: |
|
|
89
|
+
| Claude Code | — | ✓ | ✓ | ✓ | ✓ |
|
|
90
|
+
| Codex | ✓ | — | ✓ | ✓ | ✓ |
|
|
91
|
+
| Pi | ✓ | ✓ | — | ✓ | ✓ |
|
|
92
|
+
|
|
93
|
+
Claude, Codex, and Pi are sources and targets. OpenCode and Copilot are
|
|
94
|
+
currently target-only. Same-format migration is intentionally rejected.
|
|
95
|
+
Antigravity and Cursor remain fail-closed until they expose supported transcript
|
|
96
|
+
import APIs.
|
|
97
|
+
|
|
98
|
+
## What survives
|
|
99
|
+
|
|
100
|
+
- User and assistant messages, in order
|
|
101
|
+
- Tool calls and their linked results
|
|
102
|
+
- Supported inline images
|
|
103
|
+
- Portable compaction summaries
|
|
104
|
+
- Native session identity, discovery, and resume metadata
|
|
105
|
+
|
|
106
|
+
Anything target-specific is counted in a content-free migration manifest. The
|
|
107
|
+
source session is never modified.
|
|
108
|
+
|
|
109
|
+
## How it works
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
native session → validated event timeline → native target → resume
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Each reader projects a versioned native transcript into a small ordered model.
|
|
116
|
+
Each writer then emits only structures verified against the target CLI. This is
|
|
117
|
+
session migration, not text export: the target receives a discoverable,
|
|
118
|
+
resumable native session.
|
|
119
|
+
|
|
120
|
+
## More
|
|
121
|
+
|
|
122
|
+
- [CLI reference](https://github.com/xhluca/session-migrate/blob/main/docs/cli-reference.md)
|
|
123
|
+
- [Session catalog](https://github.com/xhluca/session-migrate/blob/main/docs/session-catalog.md)
|
|
124
|
+
- [Compatibility details](https://github.com/xhluca/session-migrate/blob/main/docs/format-compatibility.md)
|
|
125
|
+
- [Troubleshooting](https://github.com/xhluca/session-migrate/blob/main/docs/troubleshooting.md)
|
|
126
|
+
- [Format research and validation](https://github.com/xhluca/session-migrate/blob/main/docs/validation-report.md)
|
|
127
|
+
- [Data handling and architecture](https://github.com/xhluca/session-migrate/blob/main/docs/architecture.md)
|
|
128
|
+
|
|
129
|
+
The demo above is generated by the real CLI from synthetic, credential-free
|
|
130
|
+
fixtures. [Watch the MP4](https://github.com/xhluca/session-migrate/raw/main/docs/assets/demo.mp4)
|
|
131
|
+
or [reproduce it](https://github.com/xhluca/session-migrate/blob/main/scripts/render-demo.sh).
|
|
132
|
+
|
|
133
|
+
<a href="https://session-migrate.team-reddy-mila.chatgpt.site">
|
|
134
|
+
<img src="https://raw.githubusercontent.com/xhluca/session-migrate/main/docs/assets/landing.png" alt="session-migrate project website" width="860">
|
|
135
|
+
</a>
|
|
136
|
+
|
|
137
|
+
## Contributing
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
git clone https://github.com/xhluca/session-migrate.git
|
|
141
|
+
cd session-migrate
|
|
142
|
+
uv sync --dev
|
|
143
|
+
uv run pytest
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
See [the development guide](https://github.com/xhluca/session-migrate/blob/main/docs/development.md)
|
|
147
|
+
before changing a native
|
|
148
|
+
adapter. New formats need sanitized fixtures and a real native-resume oracle.
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
[MIT](https://github.com/xhluca/session-migrate/blob/main/LICENSE)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<h1 align="center"><a href="https://session-migrate.team-reddy-mila.chatgpt.site">↝ session-migrate</a></h1>
|
|
2
|
+
|
|
3
|
+
<p align="center"><strong>Carry the conversation forward.</strong></p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://pypi.org/project/session-migrate/"><img src="https://img.shields.io/pypi/v/session-migrate?style=flat-square&color=b8f94a&label=PyPI" alt="PyPI version"></a>
|
|
7
|
+
<a href="https://pypi.org/project/session-migrate/"><img src="https://img.shields.io/pypi/pyversions/session-migrate?style=flat-square" alt="Python versions"></a>
|
|
8
|
+
<a href="https://github.com/xhluca/session-migrate/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-8dbdff?style=flat-square" alt="MIT license"></a>
|
|
9
|
+
<a href="https://session-migrate.team-reddy-mila.chatgpt.site"><img src="https://img.shields.io/badge/website-live-b8f94a?style=flat-square" alt="Project website"></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://raw.githubusercontent.com/xhluca/session-migrate/main/docs/assets/demo.gif" alt="session-migrate converting a Claude Code session into a native Codex session" width="860">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
Move local coding-agent sessions between <strong>Claude Code</strong>,
|
|
18
|
+
<strong>Codex</strong>, <strong>Pi</strong>, <strong>OpenCode</strong>, and
|
|
19
|
+
<strong>GitHub Copilot CLI</strong>.
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv tool install session-migrate
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
No `uv`? Use the standalone installer:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -LsSf https://raw.githubusercontent.com/xhluca/session-migrate/main/install.sh | sh
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`pipx install session-migrate` works too. Python 3.11+ and Linux are currently
|
|
35
|
+
supported. The full command is `session-migrate`; `smigrate` is the shorthand.
|
|
36
|
+
|
|
37
|
+
## Quick start
|
|
38
|
+
|
|
39
|
+
Inspect any native transcript without printing its conversation:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
smigrate inspect ~/.claude/projects/-work/SESSION.jsonl
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Move a Claude session into Codex and resume it from the same project directory:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
smigrate transfer SESSION_UUID --from claude --to codex --cwd "$PWD"
|
|
49
|
+
codex resume NEW_SESSION_UUID
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or find an older session by title first:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
smigrate catalog refresh
|
|
56
|
+
smigrate catalog search "authentication refactor"
|
|
57
|
+
smigrate transfer --catalog-id RESULT_ID --to pi
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Compatibility
|
|
61
|
+
|
|
62
|
+
| Source ↓ / Target → | Claude | Codex | Pi | OpenCode | Copilot |
|
|
63
|
+
| --- | :---: | :---: | :---: | :---: | :---: |
|
|
64
|
+
| Claude Code | — | ✓ | ✓ | ✓ | ✓ |
|
|
65
|
+
| Codex | ✓ | — | ✓ | ✓ | ✓ |
|
|
66
|
+
| Pi | ✓ | ✓ | — | ✓ | ✓ |
|
|
67
|
+
|
|
68
|
+
Claude, Codex, and Pi are sources and targets. OpenCode and Copilot are
|
|
69
|
+
currently target-only. Same-format migration is intentionally rejected.
|
|
70
|
+
Antigravity and Cursor remain fail-closed until they expose supported transcript
|
|
71
|
+
import APIs.
|
|
72
|
+
|
|
73
|
+
## What survives
|
|
74
|
+
|
|
75
|
+
- User and assistant messages, in order
|
|
76
|
+
- Tool calls and their linked results
|
|
77
|
+
- Supported inline images
|
|
78
|
+
- Portable compaction summaries
|
|
79
|
+
- Native session identity, discovery, and resume metadata
|
|
80
|
+
|
|
81
|
+
Anything target-specific is counted in a content-free migration manifest. The
|
|
82
|
+
source session is never modified.
|
|
83
|
+
|
|
84
|
+
## How it works
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
native session → validated event timeline → native target → resume
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Each reader projects a versioned native transcript into a small ordered model.
|
|
91
|
+
Each writer then emits only structures verified against the target CLI. This is
|
|
92
|
+
session migration, not text export: the target receives a discoverable,
|
|
93
|
+
resumable native session.
|
|
94
|
+
|
|
95
|
+
## More
|
|
96
|
+
|
|
97
|
+
- [CLI reference](https://github.com/xhluca/session-migrate/blob/main/docs/cli-reference.md)
|
|
98
|
+
- [Session catalog](https://github.com/xhluca/session-migrate/blob/main/docs/session-catalog.md)
|
|
99
|
+
- [Compatibility details](https://github.com/xhluca/session-migrate/blob/main/docs/format-compatibility.md)
|
|
100
|
+
- [Troubleshooting](https://github.com/xhluca/session-migrate/blob/main/docs/troubleshooting.md)
|
|
101
|
+
- [Format research and validation](https://github.com/xhluca/session-migrate/blob/main/docs/validation-report.md)
|
|
102
|
+
- [Data handling and architecture](https://github.com/xhluca/session-migrate/blob/main/docs/architecture.md)
|
|
103
|
+
|
|
104
|
+
The demo above is generated by the real CLI from synthetic, credential-free
|
|
105
|
+
fixtures. [Watch the MP4](https://github.com/xhluca/session-migrate/raw/main/docs/assets/demo.mp4)
|
|
106
|
+
or [reproduce it](https://github.com/xhluca/session-migrate/blob/main/scripts/render-demo.sh).
|
|
107
|
+
|
|
108
|
+
<a href="https://session-migrate.team-reddy-mila.chatgpt.site">
|
|
109
|
+
<img src="https://raw.githubusercontent.com/xhluca/session-migrate/main/docs/assets/landing.png" alt="session-migrate project website" width="860">
|
|
110
|
+
</a>
|
|
111
|
+
|
|
112
|
+
## Contributing
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
git clone https://github.com/xhluca/session-migrate.git
|
|
116
|
+
cd session-migrate
|
|
117
|
+
uv sync --dev
|
|
118
|
+
uv run pytest
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
See [the development guide](https://github.com/xhluca/session-migrate/blob/main/docs/development.md)
|
|
122
|
+
before changing a native
|
|
123
|
+
adapter. New formats need sanitized fixtures and a real native-resume oracle.
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
[MIT](https://github.com/xhluca/session-migrate/blob/main/LICENSE)
|