Skip to content

tornikegomareli/agent-teleport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agent-teleport

License: MIT Bun TypeScript Tests GitHub release

Convert AI coding agent sessions between formats, switch between agents without losing conversation history

Currently supports: OpenCode → Claude Code

Why?

When you switch between AI coding agents (OpenCode, Claude Code, Codex, etc.), all conversation history is lost. agent-teleport reads sessions from one agent's storage and writes them into another agent's format, so you can pick up right where you left off.

Install

Requires Bun >= 1.0.

# Install globally
bun install -g agent-teleport

# Or run directly
bunx agent-teleport

Standalone binary

git clone https://github.com/tornikegomareli/agent-teleport.git
cd agent-teleport
bun install
bun run build  # produces ./agent-teleport binary

Usage

List sessions

# List all OpenCode sessions
agent-teleport list

# Filter by project directory
agent-teleport list -d /path/to/project

Sessions are grouped by project directory. Main sessions show with , subagent sessions are nested underneath with .

Convert sessions

# Interactive session picker
agent-teleport convert

# Convert a specific session
agent-teleport convert <session-id>

# Convert all sessions for a project
agent-teleport convert --all -d /path/to/project

# Preview without writing files
agent-teleport convert <session-id> --dry-run

# Read from OpenCode export JSON instead of DB
agent-teleport convert --from-json exported-session.json

# Custom database path
agent-teleport convert <session-id> --db /path/to/opencode.db

After converting, open Claude Code in the same project directory and run it with --continue flag.

Flags

Flag Description
--from Source format (default: opencode)
--to Target format (default: claude-code)
--db Override OpenCode database path
--from-json Read from OpenCode export JSON file
--all Convert all sessions
-d, --directory Filter by project directory
--dry-run Print JSONL output without writing files
-v, --verbose Show detailed conversion info

How it works

agent-teleport uses a pluggable reader/writer architecture with a common intermediate representation (IR):

Reader(source) → IR → Writer(target)

Adding support for a new agent only requires implementing a reader, a writer, or both — all existing conversions work automatically.

What gets converted

  • User messages and assistant responses
  • Tool calls (Bash, Read, Write, Edit, Glob, Grep, etc.) with inputs and outputs
  • Thinking/reasoning blocks with cryptographic signatures
  • Multi-step assistant turns (split by step boundaries)
  • Token usage metadata and model information

Edge cases handled

  • Pending/running tool calls → converted as error: [Tool execution was interrupted]
  • Compaction parts → skipped (internal to OpenCode context management)
  • Subtask/agent parts → included as text annotation
  • File attachments → converted to text: [Attached file: <filename>]
  • Error-only messages with no content → skipped

Supported agents

Agent Reader Writer
OpenCode Yes
Claude Code Yes
Codex Planned Planned
Cursor Planned Planned
Aider Planned Planned

Contributing

See CONTRIBUTING.md for how to add readers/writers for new agents.

License

MIT

About

Agent agnostic session portability, teleport your sessions between coding agents with ease

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors