baton

baton

MCP.Pizza Chef: Kaseban

baton lets you switch your AI coding sessions between popular coding assistants like Claude Code, OpenCode, Codex, Gemini CLI, Cursor, and more. Instead of starting over when you hit limits or want a second opinion, baton converts your session so you can pick up exactly where you left off in another app. It works locally, requires no API keys, and can be installed easily with a simple command. Compatible with VS Code and other editors, baton keeps your coding conversations in sync and saves you time.

Coding
Other

Use This MCP server To

Switch coding sessions seamlessly between different AI coding assistants Resume interrupted coding work in a different editor or tool Try a second AI coding assistant on the same problem without losing context Archive or share your coding session in a universal format Import a past coding conversation into a new AI tool to continue work Avoid re-explaining your coding plan when switching tools Keep all your AI coding conversations in sync across apps

README

baton

Pass the baton between coding agents.

Convert any coding-agent session to any other. One command. Keep going where you left off.

crates.io npm CI agents license

baton converting a Claude Code session to opencode

A passed transcript kept 14/17 concrete facts. A hand-written handoff summary kept 3/17. Benchmark ↓


The 4 p.m. problem

It's 4 p.m. Claude Code says "usage limit reached — resets at 10 p.m." You're three hours into a session: architecture decided, edge cases mapped, half the diff written.

❌ Without baton — open another agent and start from zero. Re-explain the plan. Re-read the files. Re-litigate every decision you already made.

✅ With baton — pass the session and keep going:

baton convert --from claude-code --to opencode --latest --import
# using latest claude-code session: 2026-07-09 15:58  Refactor the auth middleware to…
# passed baton: claude-code → opencode (1388 messages) → handoff.json
# Imported session: ses_8c4c973a521549e2

opencode -s ses_8c4c973a521549e2   # same conversation, different runner

Works in every direction: switch agents mid-task, try a second opinion on a hard bug, move a session from your editor agent to a terminal agent, or archive everything in one format.

Quick start

# zero-install run (downloads prebuilt binary)
npx @kasabeh/baton-mcp --help

# convert your most recent session + auto-import into the target agent
baton convert --from claude-code --to opencode --latest --import

# or omit the path to pick interactively — newest first,
# each session previewed by its first user message
baton convert --from claude-code --to opencode --import

# or pass an explicit session file
baton convert --from claude-code --to opencode <session.jsonl> --import

# see every session on your machine, across all agents
baton list

baton FAQ

Can I use baton to continue a coding session started in Claude Code with OpenCode?
Yes — baton converts your session so you can pick up exactly where you left off in OpenCode or other supported coding agents.
Does baton work with VS Code and Cursor?
Yes — baton supports session conversion for VS Code-based agents like Cursor and Cline, though some have limited write support.
Do I need an API key or account to use baton?
No — baton runs locally and does not require any API keys or accounts.
How hard is it to set up baton?
Setup is straightforward — you can install it with a simple copy-paste command using npx or Homebrew and configure it easily.
Which coding agents does baton support?
It supports Claude Code, Codex CLI, OpenCode, Gemini CLI, Zed, Aider, Cursor, Cline, and more.
Can baton import sessions automatically into the target agent?
Yes — for some agents like OpenCode, baton can convert and auto-import your session in one step.
Where does baton find my coding sessions?
Baton automatically scans common session storage locations for supported agents, so you don't have to find files manually.