Skip to main content Switch to mobile version batonpass-cli 0.5.1 Never drop the baton. Read-only archive of the AI history on your machine, portable to the next one.
pip install batonpass-cli==0.5.1 Copy PIP instructions
Never drop the baton. Switch machines mid-task — your work picks up exactly where you left it.
You are 3 hours into a task on the Mac mini. You open the laptop. Nothing is there.
Not the transcript, not the tool output that told you which endpoint 404'd, not the reason you rejected the third approach. You remember the concept — "the岗位表 thing, I fixed the join" — and you spend 20 minutes re-deriving what you already knew.
batonpass is the thing that hands the baton over: from one machine to the next, from last-week-you to today-you, without the work touching the ground.
batonpass discover # what AI history is on this machine? (read-only, 2 s) batonpass archive # pull it into a portable library (~1 min per GB) batonpass export --text # read one conversation back out batonpass sync push ~/Dropbox/baton # one file per machine, summaries only (~2 MB) batonpass sync pull ~/Dropbox/baton # on the other machine: 713 sessions, zero messages batonpass index # local search index, ~17 s per 700 sessions batonpass find "岗位表" --at 7d # search it, with time windows batonpass tasks # every project, one line each batonpass resume # handover card for the directory you are in The rule that makes this safe to point at your machine
batonpass never writes to your AI tools' data. Ever.
Your Claude / Codex / Cursor / zcode / dsh / billion databases are opened mode=ro. No schema migrations, no ALTER TABLE, no "helpful" cleanup. If a tool ships a new schema tomorrow, batonpass reads what it can, names what it couldn't, and never touches the file to find out.
This is not a preference, it's the first law, and discover is built to prove it: it refuses to import a networking module, and it records any source it had to open immutably instead of silently proceeding.
Read-only in · you own the copy out.
Start here: batonpass discover
Before you trust a tool with your history, look at what's actually there.
uvx --from batonpass-cli batonpass discover --report ~/Desktop/batonpass-report.html One file, standard library only, a few seconds, no network, no writes. It produces a single self-contained HTML page telling you:
what it found — 261,354 messages across 713 conversations in 9 sources, 2.2 GB on my machine
how much it can actually read — every source gets a coverage verdict, not a vibe
what it is silently failing to read, and why — a skip ledger: browser-cache: 14, backup-copy: 4, nested-artifact: 1. A skip you can see is not a silent skip.
what it refused to guess — databases it recognised without a known adapter, with the reason and a repro command, so you can open an issue instead of debugging alone
A real run on this machine:
261,354 messages · 713 conversations · 9 sources recognised · 2.2 GB 26 files skipped (browser caches, backups) · 7 dirs still in the queue billion 212,433 msg 385 sess 1,489.9 MB degraded: media-by-reference zcode 48,078 msg 304 sess 847.8 MB ok alma 75 msg 2 sess 11.4 MB ok zcode-tasks 203 tasks 10 projects 5 hosts ok (role: index) Note the third line: 1.4 GB of that source is media stored by reference — the text is fine, the images aren't in the DB. batonpass says so up front instead of handing you a 176 MB archive that turns out to be empty in the middle.
Then: three tiers, pick your cost
Tier C is the interesting one, and it's built on a deliberate split:
2 MB of catalog first, the details only when you ask.
A new machine doesn't download your history. It downloads an index — who, when, which task, which file — in about two seconds, and then pulls transcripts for the task you're actually continuing. Measured on real data: message.data gzips 5.43 MB → 0.80 MB and zstd-19s to 0.28 MB (19.7×). You don't need the other 250 MB to keep working.
Why a baton, and not a sync
When you're mid-task on two machines, the second machine doesn't need a merge, it needs to know what you already decided. So the store is append-only and the conflict rule is one line: fork, never merge. Two machines can't corrupt each other because neither one writes the other's file. Transcripts are immutable facts; the only mutable thing is task.status, which is itself a stream of appended events.
The result: you can work on the Mac mini and the laptop at the same time, and batonpass resume will show you both branches and tell you they diverged — instead of picking one silently and losing the other.
archive, measured end-to-end on this machine — all five sources, one pass:
712 sessions · 261,310 messages · 484,573 parts · 52 s 2.2 GB of source databases → 466 MB portable library 448 MB of plaintext → 179.5 MB stored (2.50×, trained dict + zstd-19) The number that matters more than the ratio: running it again adds zero rows. Counts reconcile against the sources exactly — 304/304 sessions, 48,168/48,168 messages — and parts match once you account for the 72,184 step-start / step-finish rows it skips by name. A message with no prose (a tool call, a reasoning block) becomes a structured part instead of being thrown away. Nothing is dropped silently; anything unaudited is reported as a number you can argue with.
identity + find, measured on that same 713-session library:
713 sessions → 12 real projects · 558 honestly ungrouped 57 sessions folded into `xueji`, 50 into `gp` 6,479 deliverables → found in 575 sessions (xlsx, csv, pdf, png, md…) 58,508 messages indexed → 16.6 s one-off · 164 MB · 59212 docs batonpass find 岗位表 → one hit, with the sentence it appeared in batonpass find 妖族 → nothing (it never appears — 妖股 does) And the round trip, on a machine that has never seen the data — it pulls 356 KB of catalog (t0) and can already say what is in flight:
pull t0 → 713 sessions, 713 new, 0.04 s batonpass tasks → 12 projects, sizes, devices, stale marks batonpass card xueji → the same card, forks and all The ungrouped 558 are the point. Every one of them had a session title that looked like a project name ("这道题我做错了,帮我讲讲"), and promoting those produced 400 clusters of one — structure that was pure invention. They stay searchable; they are just not lied about.
sync, measured the same way — a real 713-session library, a channel folder, and a second library that has never seen any of those apps:
library 528 MB → channel 2.8 MB push 713 sessions in 2.0 s t0 catalog 356 KB t1 summaries 2.70 MB (incl. the files each session produced) fresh machine reads t0 0.04 s → 713 sessions, 0 messages then t1 0.05 s → every session has a first ask, its last rounds, and the files it produced deep-pull one task 0.14 s → 64 messages, 256 parts, 317 blobs verify: 64/64 message hashes identical, 0 bodies differ A channel is just a folder — a shared volume, a synced directory, a git remote, a USB stick. Each machine appends only to its own file, so there is no lock, no leader and no merge step, and pulling never writes into the channel. Everything is addressed by the sha256 of its plaintext, which is why the same line arriving twice is indistinguishable from it arriving once. The one cost of append-only: a re-pushed summary leaves the old line behind, and a reader takes the last one. So a stream gets rewritten once it has grown past a floor — sync compact (and every push, when it is worth it):
3 pushes of the same 713 sessions → 1005 KB · 2139 lines sync compact → 335 KB · 713 lines (one line per session) Each rewrite bumps a generation counter in heads/ . .json. A reader keys its byte offset on the generation, so a rewritten file simply looks new and is read from zero — safe precisely because every import is an idempotent INSERT OR IGNORE.
When the channel is a cloud drive
A folder on someone else's disk is a folder on someone else's disk. Say so at init:
export BATONPASS_KEY='the passphrase you will type on every machine' batonpass sync init ~/Nutstore/batonpass --encrypt Every payload is sealed with AES-256-GCM before it lands on the drive, keyed by scrypt from that passphrase; blobs already in the channel are re-sealed in place. The key is never written into the channel — it comes from BATONPASS_KEY or ~/.batonpass/key. Addressing stays on the plaintext sha256, so a re-sent message still lands on exactly the same path, and a wrong passphrase produces one sentence ("this channel is encrypted and the key does not match") instead of a corrupt-archive mystery.
What is not sealed: the catalog lines themselves, because dedupe keys live there. So the drive's operator can see that you had 713 sessions with these titles on these dates — not a word of what was said. That leak is real and small, and stating it is the point.
If it ever doesn't work, it says why instead of throwing:
$ batonpass doctor --channel ~/Dropbox/batonpass OK python 3.9.6 OK sqlite 3.54.0, fts5 + trigram WARN zstd not installed — archives stay readable, 2.50x becomes 2.04x → pip install "batonpass-cli[zstd]" OK library 680.6 MB, 713 sessions, 263,256 messages OK identity 12 named project key(s), 558 honestly ungrouped OK channel id c62264a7f0b4, 1 device(s), 0 B Letting the AI tools call it
batonpass mcp is an MCP server on stdio — no daemon, no port, nothing left running when the client exits. Three tools, because that is the whole vocabulary an agent needs: memory_search (look something up by a vague phrase), memory_add (write down what it just learned, before it is forgotten), resume (hand the baton over).
{"mcpServers": {"batonpass": {"command": "uvx", "args": ["batonpass", "mcp"]}}} The silence contract applies here too: a search that finds nothing returns "not found — do not invent one", because a model that hallucinates a file path costs you twenty minutes of looking for a file that never existed.
If you run it and it doesn't recognise a source you use, that is the most useful bug report there is — please use the unrecognized source template. It asks for a schema fingerprint, not your data.
Not a memory layer. memory-bridge and friends remember conclusions. This keeps the transcript — the 40 tool calls that produced the conclusion. Different artifact.
Not bidirectional. There is no write-back into Claude or Cursor. That's the whole reason it's safe.
Not a cloud service. The data plane is yours: a folder, a git remote, or a machine you own. The control plane is disposable by design.
pipx install batonpass-cli # the command it gives you is `batonpass` uvx --from batonpass-cli batonpass discover # or run it without installing pip install "batonpass-cli[zstd]" # zstandard buys the 2.5x storage ratio uvx needs --from because it looks for an executable with the package's name, and this package's executable is batonpass, not batonpass-cli.
The package is batonpass-cli on PyPI, because the plain name batonpass is already spoken for — an unrelated project called baton-pass normalizes to the same string, and PyPI compares names with the separators removed. The command it installs is still batonpass.
Python 3.9+. Zero required dependencies — zstandard is the only extra, and it buys the 2.5× storage ratio. Without it, libraries written with zstd still refuse gracefully and tell you the one command to run.
The design learned from two prior projects — no source code was copied from either:
jiabaobei/memory-bridge — per-device own-file heartbeat, write-once wiring, content-freeze, handover cards with staleness windows, and the one-line session index that made "which file was it" searchable again.
Nwflower/dsh-chat-import — the Interchange IR, named degradation policies (lossless | text-fallback | skip-placeholder), multi-frame zstd decoding, and the PRAGMA table_info adaptivity that lets a reader survive schema drift.
Both solve a real slice of this problem. Neither ships a machine-to-machine handoff. That gap is what batonpass is for.
ai agent memory archive handoff sqlite read-only continuity
Development Status 4 - Beta
Intended Audience Developers
License OSI Approved :: MIT License
Programming Language Python :: 3
Release files for batonpass-cli 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 199.2 kB
Release files / batonpass_cli-0.5.1.tar.gz
Release files / batonpass_cli-0.5.1-py3-none-any.whl
Security for batonpass-cli 0.5.1
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Nov 26, 2026 2 release files No provenance
Nov 25, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




