Skip to main content

Migrate conversation history between AI coding agents

Project description

agent-migrator

A CLI tool for migrating conversation history between AI coding tools.

Supported Coding Agents

  • Claude Code (Anthropic)
  • Codex (OpenAI)
  • Gemini CLI (Google)
  • Cursor

All pairs are supported bidirectionally.


Setup

Requires uv.

Install globally (recommended):

uv tool install git+https://github.com/builderpepc/agent-migrator.git

Or run without installing:

uvx agent-migrator

Usage

Interactive

Run from inside a project directory:

agent-migrator

The CLI walks you through:

  1. Tool selection — choose source and destination.
  2. Conversation selection — pick conversations to migrate, sorted most-recent-first.
  3. Migration progress — each conversation is processed in sequence; Ctrl+C cancels and rolls back.
  4. Summary — a results table shows successes and errors.

Cursor: the project path must be a directory that has been opened as a workspace in Cursor at least once.

Non-interactive

Two subcommands expose the same engine for scripting and agentic use. Both accept --dir <path> (defaults to cwd) and print JSON to stdout; errors go to stderr as {"error": "..."} with exit 1.

List conversations:

agent-migrator list --from claude-code --dir /path/to/project
[{"id": "63ec7bb1-...", "name": "pwa-capabilities-demo", "updated_at": "2026-05-21T23:23:00", ...}]

Migrate a conversation:

agent-migrator move --from claude-code --to codex --id 63ec7bb1-... --dir /path/to/project
[{"source_id": "63ec7bb1-...", "destination_id": "019e51f7-...", "name": "pwa-capabilities-demo"}]

Omit --id to migrate all conversations for the project. Run agent-migrator list --help or agent-migrator move --help for full options.


What gets migrated

All pairs support:

Feature Status
Text messages (user and assistant)
Tool calls (Read, Write, Edit, Bash, Glob, and equivalents)
Plan (presented natively in the destination tool's plan UI)

(Any) → Cursor is the one exception: plans are migrated as context documents but are not surfaced in Cursor's native plan mode UI.

(Any) → Cursor also requires a server upload to Cursor's ConvertOALToNAL endpoint to make all models available. If that fails (e.g. not logged in), the CLI offers a local fallback that provides full context but restricts model selection to Anthropic models.


How it works

Conversations are read into a tool-agnostic normalized format (TextMessage and ToolCallMessage turns) and written out in the destination format. Each tool is implemented as a AgentAdapter subclass in agent_migrator/agents/. This decouples all source/destination pairs — adding a new tool requires only a new adapter; all existing migration paths continue to work unchanged.

Extensibility

To add support for a new coding agent, implement the AgentAdapter interface in agent_migrator/agents/ and register it in cli.py:

class MyAgentAdapter(AgentAdapter):
    name = "My Agent"
    tool_id = "myagent"

    def is_available(self) -> bool: ...
    def list_conversations(self, project_path: Path) -> list[ConversationInfo]: ...
    def read_conversation(self, conv_id: str, project_path: Path) -> Conversation: ...
    def write_conversation(self, conv: Conversation, project_path: Path, *, use_local_backend: bool = False) -> str: ...
    def delete_conversation(self, conv_id: str, project_path: Path) -> None: ...

Storage locations

Tool Location
Claude Code ~/.claude/projects/<encoded-path>/<session>.jsonl
Codex ~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<id>.jsonl
Gemini CLI ~/.gemini/tmp/<project-slug>/chats/session-<timestamp>-<id>.jsonl
Cursor %APPDATA%/Cursor/User/globalStorage/state.vscdb (SQLite)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_migrator-0.1.0.tar.gz (73.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_migrator-0.1.0-py3-none-any.whl (65.3 kB view details)

Uploaded Python 3

File details

Details for the file agent_migrator-0.1.0.tar.gz.

File metadata

  • Download URL: agent_migrator-0.1.0.tar.gz
  • Upload date:
  • Size: 73.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_migrator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90ee8d38267fe8e7526d384afd112f7cf9a41fede3cd8c0ee5be19da446bccdd
MD5 69aca6564068a1da84569317e2453da4
BLAKE2b-256 8313b136c67ffaecaa11aed0587c4caf0dc0b378c972d4c250f29fdb991c9703

See more details on using hashes here.

File details

Details for the file agent_migrator-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agent_migrator-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 65.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_migrator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 659d24c78b0f71be827e5911f19a824a4c28f7d14a19de619534cb6a77be17e5
MD5 2b85a772fc46c0b97e368be5734ca2c5
BLAKE2b-256 1a3480e669373425ce4cdeb38566afe757699d2acb1ec67584d30a38abac28c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page