
Baton
tech.kasabehPublished by kasabeh.techv0.3.0Updated Oct 27, 2026
Pass the baton between coding agents: convert sessions across Claude Code, OpenCode, Codex & more.
Overview
Baton converts coding-agent sessions between Claude Code, OpenCode, Codex and others, letting an assistant list, convert and import transcripts.
- What you can do
- List sessions across all supported coding agents with their file paths
- Convert a session from one agent's format to another
- Convert and run the target agent's import command
- Detect which agent produced a given session file or directory
- When to use it
- Useful when you hit a usage limit or want to switch agents mid-task and keep the full transcript instead of re-explaining the plan. Also handy for trying a second opinion on a hard bug or archiving sessions in one format.
- Requirements
- Runs as a local stdio process, typically via npx with the npm package, which downloads a prebuilt binary; also installable via npm, Homebrew, Cargo or a shell installer. Desktop only, with no declared authentication, environment variables or headers. Session files are read from local agent directories such as the Claude Code and Codex CLI folders.
Installation
In SourceWeft
- Open Baton in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
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:
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
Where do session files live?
You never have to hunt these down (--latest and the interactive picker find them for you), but for reference — each agent stores its transcripts on disk:
baton list prints the path of every session it can find, across all agents.
Supported formats
¹ Cursor reads from exported JSON (sqlite3 state.vscdb "SELECT value FROM ItemTable WHERE key='aiService:chats'")
² Not planned: Cursor and Cline keep session state inside editor databases (SQLite / VS Code globalState) with no file-level import path.
Benchmark
Does carrying the full transcript beat writing a handoff summary for the next agent? We measured both on a real 3.4 MB Claude Code session (same model both arms, only the context differs):
The summary lost concrete facts (versions, line counts, MSRV) even on the smallest slice — the receiving agent had to re-read files and re-run commands to rediscover them. Mechanical fidelity: all 896 messages are written to every target; round-trip loss reflects each target format's expressiveness (claude-code 896/896, codex 736, gemini-cli 723, aider 111 — it stores chat text only).
We also measured task continuation: cut the session at three mid-task points, ask a fresh agent to state the task, state, and next steps. Result: parity (baton 10/12, handoff 10/12) — a good summary is enough for what to do next; the transcript is what answers the specific factual questions the summary's author didn't anticipate. And the summary only exists if an agent spends a full transcript read writing it — baton makes the transfer free.
Full methodology, caveats, and reproduction steps: benchmark/RESULTS.md.
MCP server
baton is also an MCP server — your agent can pass the baton itself, mid-conversation:
How it works
Every agent format is read into a canonical intermediate representation, then written out in the target format. Adding a new format is O(1), not O(N×M) per-pair converters.
Install
Or grab a binary from GitHub Releases.
Building
Contributing
Each format lives in src/formats/<name>.rs and implements the Format trait (read + write). See src/formats/claude_code.rs for a complete reference implementation.
All nine formats have readers; Claude Code, OpenCode, Codex, Zed, Aider, and Gemini CLI also have writers. The most impactful contribution now is a writer for Continue.
Regenerating the demo
The README GIF is scripted with VHS: vhs assets/demo.tape. It records against a sandboxed $HOME (/tmp/demo) populated with fabricated sessions, so no real session data ends up in the GIF.
Don't drop the baton.
License
Dual-licensed under MIT OR Apache-2.0.
Source: README.md at commit 4526159
Tools
0Version history
1- v0.3.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
