Cross Agent Session Resumer (casr) moves a coding-agent session from one provider to another. AI coding sessions are normally siloed by the tool that created them, so a session started in Codex cannot be resumed directly in Claude Code. casr reads a session into a canonical intermediate model, writes a native session file for the target provider, and prints the exact command to resume it there.
The pipeline discovers which provider owns a session ID, reads the native format into a canonical session of messages, roles, tool calls, and metadata, validates it (rejecting empty or one-sided sessions and warning on timestamp gaps or metadata loss), and writes a target-native file. Writes are atomic (temporary file, then rename) with conflict detection and an optional backup, and the output is read back and compared for structural fidelity before casr reports success. A JSON mode and structured logging support scripting and automation.
Supported providers include Claude Code, Codex, Gemini CLI, Antigravity (read only), Cursor, Cline, Aider, Amp, OpenCode (legacy databases for writing), ChatGPT, Vibe, Factory, OpenClaw, Pi, Kiro CLI, and Grok Build, each with its own read, write, and resume-command support. New providers are added through a shared provider trait. Typical use is switching models mid-task, recovering from a provider outage by moving the same session elsewhere, or continuing an old session after a tooling migration.
The tool is written in Rust and runs on macOS, Linux, and Windows. Shorthand commands auto-detect the source provider from a session ID, and a providers command lists which providers are installed and available for conversion.
Features
- Cross-provider resume: convert a session between providers with one command and get the exact resume command
- Canonical model: provider formats normalized into a common session of messages, roles, tool calls, and metadata
- Native-format writers: produces real provider-native session files, not intermediate-only exports
- Provider auto-detection: finds which installed provider owns a session ID
- Safe writes: atomic temp-then-rename writes, conflict detection, and an optional backup
- Read-back verification: the written session is re-read and compared for structural fidelity
- Validation: hard errors on empty or one-sided sessions, warnings on timestamp gaps or metadata loss
- Machine output: a JSON mode and structured logging for scripts and automation
- Broad provider support: Claude Code, Codex, Gemini CLI, Cursor, Cline, Aider, Amp, OpenCode, ChatGPT, OpenClaw, Pi, Kiro CLI, and Grok Build


