# baton

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 27
- Author: Kaseban
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Kaseban/baton
- Updated: 2026-10-16
- HTML: https://affpapa.org/en/nevibecode/mcp/baton

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add baton -- npx -y @kasabeh/baton-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add baton -- npx -y @kasabeh/baton-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "baton": {
            "command": "npx",
            "args": [
                "-y",
                "@kasabeh/baton-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "baton": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@kasabeh/baton-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add baton npx -y @kasabeh/baton-mcp
```

## When to use it
- 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
- 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`?

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
