
Baton
tech.kasabeh由 kasabeh.tech 發布v0.3.0更新於 Oct 27, 2026
Pass the baton between coding agents: convert sessions across Claude Code, OpenCode, Codex & more.
概覽
Baton 在 Claude Code、OpenCode、Codex 等編碼代理之間轉換工作階段,讓助理列出、轉換並匯入對話紀錄。
- 可以做什麼
- 列出所有支援編碼代理的工作階段及其檔案路徑
- 把工作階段從一種代理格式轉換成另一種格式
- 轉換並執行目標代理的匯入指令
- 辨識某個工作階段檔案或目錄由哪個代理產生
- 適用情境
- 適合在遇到用量上限或想中途更換代理時使用,保留完整對話紀錄而不必重新說明計畫。也適合對疑難問題尋求第二意見,或把工作階段統一歸檔成一種格式。
- 執行需求
- 以本機 stdio 程序執行,通常透過 npx 呼叫 npm 套件並下載預先編譯的執行檔;也可用 npm、Homebrew、Cargo 或 shell 安裝腳本安裝。僅限桌面環境,未宣告驗證、環境變數或請求標頭。工作階段檔案從本機代理目錄讀取,例如 Claude Code 與 Codex CLI 的資料夾。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Baton,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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.
來源:README.md,提交 4526159
工具
0版本歷史
1- v0.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
