Moving a DSH session between two machines
Why a copied session does not open
A session file is a multi-frame zstd stream. Frame zero is one JSON line and it records the absolute working directory: "cwd":"C:\\Knowledge base".
Two things follow from that string. The folder the file must live in (sessions/--<projectKey>--/<id>/), where the project key is derived from the path. And the workspace it belongs to, which is an entry in storages/workspace.json pointing at the same path.
Copy the file to another machine and both are wrong. The app either refuses the file outright or lists it and cannot place it. Neither failure mentions the cwd, which is why people conclude the file is corrupt.
The mailbox is a directory, not a service
A ticket is a folder: outbox/<device>/<stamp>/ with an envelope, a manifest, the session files, and any attachments it references. That is the whole protocol.
I use a private git repository as the transport, so sync commits and pushes and pull only fetches. A synced folder works the same way; the tool never opens a port and never talks to a server.
Local state stays local: seen.json, devices.json, and config.json are excluded from the repository, because they differ per machine and would collide on every merge.
git clone <your-private-repo> ~/.dsh/handoff
npm i -g @mrwilliam/dsh-handoff
dash-handoff statusThe one window where DSH must stop
The workspace index is a single JSON file the running app keeps in memory and rewrites as a whole. Write it while DSH is up and your change survives until the next save, then disappears. No error.
So the import has two phases. On Windows the tool handles it: it schedules a one-shot task that stops the service, imports, starts it again, and checks the port — about fifteen seconds, and the page drops once while it happens.
On macOS the restart helper is not implemented, so --restart manual is the honest setting: you stop DSH, run the import, start it again. If the tool still reports exit 4, it found something that looks like a live session; stop it properly rather than skipping the check.
dsh-handoff inbox
dash-handoff receive <ticket> --yesThree things that go wrong after the import
The session opens but sits in no workspace. Nothing owned that path on this machine yet. Open that project folder in the app once — the next save adds it.
The attachments are missing. Copy them from the ticket with the tool rather than by hand: they are content-addressed, and older installs used three different subfolders (file-objects, objects, files).
The sender still shows "waiting". Your receipt (.receipt-<device>.json) was written inside the ticket folder on your machine and has not been pushed yet. Run sync.
When both machines wrote to the same session
Do not compare timestamps; clocks lie, and a suspended laptop makes them lie more. Files are append-only, so the honest test is a byte-prefix test: if one file is a prefix of the other, it is the older one.
If neither is a prefix the session diverged. Your file is left untouched and the incoming copy lands beside it as session.<id>.incoming-<stamp>. Picking one is a human decision; the tool does not guess.
dsh-handoff plan <ticket>
dash-handoff apply <ticket> --yesWhat to check before you trust it
Open the imported session, scroll up, and confirm the history is there — not just that the title matches.
Fork it once and send a message. That is the real test: a fork reuses the working directory, so a successful reply proves the mapped path exists and is writable.
Check the source machine: its file hash should be unchanged after sending. The tool only rewrites the header on the receiving side, so the original keeps its identity.
The tool, and the prompt that installs it
Everything above is what the tool automates: Handoff. That page also carries a ready-made prompt you paste into DSH to install and verify it on a machine.