**What I built**
Baton is an open-source (MIT) tool for handing off work between AI agent sessions and people. I built it with Claude Code,
and it's designed first for Claude Code users (plugin with `/handoff` and `/receive`), though it also works with
any MCP client.
**The problem**
When a Claude Code session ends, the context fills up, or I hand work to a teammate, the knowledge dies. The next session
rediscovers everything, or someone pastes a huge transcript that's noisy, can't be checked, and sometimes contains secrets.
**What it does**
Your agent packages what it knows into a small, structured handoff packet:
- a summary of the goal and current state
- facts, each citing one source (`file:line`, the exact command, a URL, a ticket, or the person who said it) and marked verified / inferred / reported
- decisions, plus the alternatives that were rejected and why
- pitfalls: dead ends and misleading signals
- open items, where the first one is a concrete next step
Then:
- a secret/PII scan runs locally before anything leaves your machine, and sending is blocked until findings are fixed or masked
- the packet is hashed and signed (ed25519)
- the receiver runs `/receive <link or file>`. Baton checks the signature, re-checks every `file:line` against their checkout, and marks changed sources as stale. It loads the packet fenced as untrusted data, so instructions hidden inside it can't hijack the receiving agent. The agent summarizes, proposes the next step, and waits for confirmation.
You can use it solo with plain files (`/handoff me` at night, `/receive last` the next morning) or with an optional
self-hosted team server: expiring/revocable links, roles, SSO + SCIM, encryption at rest, and an audit log.
There are also configs for Cursor, VS Code Copilot, Windsurf, Codex CLI, Gemini CLI and Zed, plus TS/Python SDKs.
**How Claude Code helped**
I started with a written plan: product spec, architecture, packet format, security model. I worked through it with
Claude Code (Opus) and it did most of the implementation:
- scaffolded the TypeScript monorepo and wrote the packet schema, signing, redactor, MCP server, CLI and team server
- wrote the tests (60, including server end-to-end tests against embedded Postgres, and tests that tampered packets
and prompt-injection attempts are caught), then ran them and fixed what failed
- did a real smoke test: started the server, sent a packet from the CLI and received it back, and caught a couple of
bugs that way (e.g. the redactor was flagging the author's own email in the packet header)
- wrote the CI, Docker/Helm setup and docs, and after the first push fixed the GitHub CodeQL alerts it got
(a regex that could slow down on hostile input, and startup errors that could log config values)
My part was the product decisions, the plan, reviewing, and steering, e.g. keeping it vendor-neutral and treating
received packets as untrusted data. It would have taken me weeks alone.
**Free to try**
It's free and open source (MIT); everything in the repo is free. Not on npm yet, so build from source (~1 min):
git clone https://github.com/RK905/baton && cd baton
pnpm install && pnpm build
claude mcp add baton -- node $(pwd)/packages/mcp/dist/index.js
Then, in Claude Code, ask it to hand off the session, and in a fresh session ask it to receive the packet.
Or install the plugin: `/plugin marketplace add RK905/baton` → `/plugin install baton@baton`
(the plugin calls the npm package, which isn't published yet, so use the `claude mcp add` route for now).
**Limitations**
- v0.1
- redaction is regex + entropy based: it catches common formats, not everything, so review before sending
- verification checks that sources still exist and haven't changed; it doesn't prove the reasoning is right
- no web dashboard yet
Repo: https://github.com/RK905/baton
Feedback I'd find most useful: what's missing from the packet format, secret formats the redactor misses