Skip to content

Ryu0118/ctxmv

Repository files navigation

ctxmv - A CLI tool to migrate conversation sessions between AI coding agents.

Language Platform License release Follow @ryu_hu03

✨ You no longer need to suffer through rate limits: when one coding agent hits its limit, migrate the session to another and keep going.

Claude Code Codex Cursor
Claude Code Codex Cursor

Features

  • πŸ”€ Migrate sessions between any pair of agents (resume-compatible)
  • πŸ“‹ List sessions across all agents in a unified table
  • πŸ’¬ Show conversation messages with role-colored output

Supports

  • Claude Code
  • Codex
  • Cursor (CLI agent via cursor-agent, not the GUI app)

Install

curl -fsSL https://raw.githubusercontent.com/Ryu0118/ctxmv/main/install.sh | bash

To update, run the same command. It skips the download if already up-to-date.

# Install a specific version
curl -fsSL https://raw.githubusercontent.com/Ryu0118/ctxmv/main/install.sh | VERSION=0.1.0 bash

# Force reinstall
curl -fsSL https://raw.githubusercontent.com/Ryu0118/ctxmv/main/install.sh | FORCE=1 bash

Other methods

nest install Ryu0118/ctxmv

Mise (jdx/mise)

mise use -g ubi:Ryu0118/ctxmv

Build from source

Requires Swift 6.0+ and macOS 15+.

git clone https://github.com/Ryu0118/ctxmv.git
cd ctxmv
swift run ctxmv <subcommand>

Usage

# Claude Code β†’ Codex
ctxmv <session-id> --to codex

# Codex β†’ Claude Code
ctxmv <session-id> --to claude-code

# Any β†’ Cursor
ctxmv <session-id> --to cursor

After migration, the tool prints the resume command:

βœ… Session written to: /path/to/session
To resume:
  cd /your/project
  codex resume <new-session-id>

Note: Cursor may not render migrated past messages in TUI immediately after resume. However, conversation context is preserved and past messages are still available to the agent.

List sessions

# List all sessions across all agents
ctxmv list

# Filter by agent
ctxmv list --source claude-code
ctxmv list --source codex
ctxmv list --source cursor

# Filter by project path
ctxmv list --project /path/to/project

# Limit results
ctxmv list --limit 50

Show session messages

# Show messages for a session (full or prefix ID)
ctxmv show <session-id>

# Restrict search to a specific agent
ctxmv show <session-id> --source claude-code

# Show raw content without compacting XML-like blocks
ctxmv show <session-id> --raw

# Show only the last N messages
ctxmv show <session-id> --limit 20

# Show all messages, bypassing large-session protection
ctxmv show <session-id> --all

License

MIT

About

🏠 A CLI tool to migrate sessions between AI coding agents

Resources

License

Stars

38 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors