A DSH session file is not portable on its own. Copy it to another machine and one of two things happens: the app refuses it, or it opens into an empty group and no longer knows which project folder it belongs to.
The reason is one field. The first line of session.v4.jsonl.zstd records an absolute working directory:
{"type":"session","version":4,"id":"session-…","cwd":"C:\\Knowledge base","agentPreset":"standard"}
DSH derives two things from that string: the folder the file must live in (sessions/--<projectKey>--/<id>/) and the workspace it belongs to (an entry in storages/workspace.json). Change machines, and that string is wrong. Fix the string, and both follow.
I built a small CLI around that single fact. It is called Handoff, it is MIT, and it moves the session plus the attachments it references.
What actually moves
- the session file, with only the header's
cwdrewritten — body frames are copied byte for byte - the attachments under
attachments/v1/, deduplicated by sha256 - the id added to the workspace index, with a backup of
workspace.jsonfirst
What does not move: credentials, profiles, skills, scheduled tasks, and any file the session did not reference.
The part that took the longest
Deciding what to do when both machines have the same session and both appended to it. Timestamps turned out to be useless (clocks, time zones, resumed machines). The files are append-only frame sequences, so the honest test is a prefix test: if one file is a byte prefix of the other, that one is older. No prefix, no merge — the incoming copy is written next to yours as session.…incoming-<stamp> and both are kept.
Two failures worth writing down
I broke my own tool twice while testing it on a real pair of machines (Windows and macOS), and both failures were only reproducible on the receiving side.
-
applyread the path mapping from a flag instead of the config file. The auto-receive path passes only--homeand--yes, so the mapping was empty and every macOS-to-Windows transfer died with "no matching entry". - When the import failed, the tool still wrote
status=okbecause it only checked whether the port came back up. The next attempt then skipped the ticket as "already handled" — and it never ran at all.
Both are now covered by the kind of check that would have caught them: the import records the apply exit code, and a stale session.lock is probed with lsof instead of being trusted as proof that DSH is running.
Numbers from the real transfer
- one session with 511 frames and 22 human messages: macOS → Windows, one attachment copied, workspace index +1, title preserved
- the reverse direction: 16 frames, 2 turns, readable after import
- both sides wrote a receipt (
.receipt-<device>.json) that travels back through the mailbox, so the sender sees "received by …" in its own list - sending does not touch the source file: its sha256 matched the exported manifest afterwards
Install
npm i -g @mrwilliam/dsh-handoff
dsh-handoff status
The mailbox is a git repository you own; sync commits and pushes, pull only fetches, and prune removes tickets older than N days. No account, no server, no port to open.
What it will not do
- merge divergent session files (both are kept)
- create workspaces (a session whose path has no workspace lands ungrouped)
- write while DSH is running on Windows (the receive path stops the service first, then starts it again — about fifteen seconds)
- restart DSH on macOS: import works, stopping and starting is manual
Source and changelog: github.com/FindSomeSkills/Skills
Top comments (1)
The decision I respect most is the one to keep both divergent sessions instead of trying to merge them — for an append-only log, a bad merge corrupts both histories, and two copies with a timestamp suffix is honest about what actually happened. The second failure is the better lesson, though: the import wrote status=ok because it checked whether the service came back up, not whether the import succeeded. That is the exact shape of bug that bites in production. For the divergent case, do you ever see a real merge — interleaving frames by timestamp — or is keeping both copies the permanent answer, with the user picking the winner by hand?