Skip to main content
MCP server CX Codex

baton — Claude Code MCP server: session conversion

Moves a coding-agent session transcript into another agent's format, so you can keep working after a usage limit or get a second opinion on the same history.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add baton -- npx -y @kasabeh/baton-mcp
Open on GitHub

What baton does

baton takes a session transcript from one coding agent and writes it out for another. Nine formats can be read, including Claude Code, Codex CLI, Gemini CLI, Zed, Aider and OpenCode; six of those also accept a written session. Only OpenCode imports on its own, through opencode import.

The converter is a single pipeline: every format loads into one shared session model and is rebuilt from there. That is why a pair of agents costs a single call, baton convert --from claude-code --to opencode --latest --import. --latest picks the newest transcript, and with no path you get an interactive list showing each session's opening user message. baton list dumps every session on the machine with its file path. On a real Claude Code session the carried transcript held 14/17 concrete facts, against 3/17 for a handoff summary written by an agent.

The same binary runs as an MCP server, exposing list_sessions, convert_session, import_to_target and detect_format so the agent handles the transfer itself mid-conversation. Install comes from npm install -g @kasabeh/baton-mcp, Homebrew, cargo binstall or a shell script; after that baton install writes the server into the MCP config of every agent it finds and baton doctor confirms it. Cursor and Cline stay read-only, since their chats sit inside editor databases and there is no file-level import path back into them.

What it helps with

  • carry unfinished work into another agent after a usage limit
  • test a hard bug in a second agent on the same conversation
  • move a session from a terminal agent into an editor agent
  • inventory every session on the machine with its file path
  • identify which agent produced a stray transcript file

Example prompts for the agent

  • List every coding-agent session on this machine with its path.
  • Convert my latest Claude Code session to OpenCode and import it.
  • Which agent wrote the rollout-*.jsonl file under ~/.codex/sessions?

How to install baton

Platform CLI

claude mcp add baton -- npx -y @kasabeh/baton-mcp

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about baton

How do I install baton in Claude Code?

Run claude mcp add baton -- npx -y @kasabeh/baton-mcp. It registers the server without a Rust toolchain, since the npm package ships a compiled binary.

What does baton do?

It rewrites a session transcript into another agent's format so the conversation continues in a different runner. Where the target supports it, baton runs the import command too.

Which agents can import a session automatically?

OpenCode only, via opencode import. Every other target gets a file you attach yourself, and Cursor or Cline can be read but not written.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor