DSH Toolbox

Carry a session to the other machine

v0.1.5 · Windows and macOS

A session file is not portable on its own. Its first line records an absolute cwd, and DSH derives both the folder it must live in and the workspace it belongs to from that one string. Copy the file without changing it and the session either fails the identity check or lands outside every workspace. This tool rewrites that single field, moves the file to the matching folder, copies the attachments it references, and adds the id to the workspace that owns that path.

The Handoff page in DSH settings: mailbox path, waiting tickets, sent tickets and their receipts

The full walkthrough: why a copied session does not open, where the service must stop, what to check afterwards

First run

Four steps, once per machine. After that it is two commands.

1

Prepare the mailbox

A private git repository both machines can push to; session bytes never go anywhere else. A synced folder works too — the tool only cares about the directory layout.

git clone <your-private-repo> ~/.dsh/handoff
2

Install

Node.js 22.15 or newer, plus git. No other dependencies.

npm i -g @mrwilliam/dsh-handoff
dsh-handoff status
3

Say which machine this is

The device name becomes part of the ticket path, so the two machines must differ. The port is what the tool probes before writing anything.

dsh-handoff config --device my-mac --mailbox ~/.dsh/handoff --port 2081 --restart manual
4

Map the other folder onto this one

Longest prefix wins and the prefix must stop on a path boundary. With no matching entry the import stops at exit 2 instead of guessing. Paths go in full; in JSON a backslash is written twice.

dsh-handoff config --map ./map.json

# map.json
echo '{"cwdMap":[{"from":"<source cwd>","to":"<local path>"}]}' > map.json

Three commands and one click

send

Send one session

Mark a ticket inside the mailbox repository. The session file is copied byte for byte — the header is not touched on this side, so the original keeps its hash.

node bin/dsh-handoff.mjs send --ids session-6d75550c
git push
receive

Receive on the other machine

The header cwd is rewritten against your mapping table, the file lands under the folder that path implies, attachments are copied by sha256, and the workspace index gets the id. When this machine is running DSH, a one-shot scheduled task stops it, imports, starts it again and checks the port — about fifteen seconds.

node bin/dsh-handoff.mjs inbox
node bin/dsh-handoff.mjs receive <ticket> --yes
conflict

Two machines, same session

Judged by frames, not timestamps: whoever is a byte prefix of the other is the older copy. A real divergence keeps your local file untouched and stores the incoming one beside it — nothing is merged, nothing is overwritten.

node bin/dsh-handoff.mjs plan <ticket>

Three places in the interface

The plugin adds a settings page, a badge in the sidebar foot, and one button at the end of each session row. Nothing else changes.

What moves through it

  • sessions/<projectKey>/<id>/session.v4.jsonl.zstd
  • the cwd inside the first frame (only this field)
  • attachments/v1/<sha256>
  • the sessionIds in the workspace index

Body frames move byte for byte.

Never touched

  • .credentials.yaml
  • profiles/ skills/
  • storages/schedule.json
  • other sessions, other project folders

Not read, not hashed, not uploaded.

Both machines changed the same session

Decided by bytes, not by time. If your copy is a prefix of the incoming one, yours is older and gets replaced. If neither is a prefix they diverged: your file is left untouched and the incoming copy lands beside it as session.<id>.incoming-<stamp>. Keeping both is deliberate — the tool cannot know which branch you meant to keep.

What it will not do

Platforms

PlatformCapability
WindowsFull path: stop on receive, import, start again, verify the port.
macOSImport works; stopping and starting DSH is manual, the restart helper is Windows only.
BothSession format v4. Keep the two installs on the same minor version; a much older engine refuses a newer log.

What was actually verified

Get it

Single file, no dependencies beyond Node.js 22.15 and git. The mailbox is a private git repository you own — session bytes never leave your machines for anyone else.

npm i -g @mrwilliam/dsh-handoff
dsh-handoff status

No global install wanted? Take the zip from the mailbox repository and run it in place.

Source and changelog on GitHub

When something goes wrong

Removing it

Uninstalling the command line leaves the mailbox and the imported sessions alone. The plugin is a single directory inside the profile.

npm rm -g @mrwilliam/dsh-handoff
dash plugin --profile web remove dsh-handoff-panel

Requirements and licence

Node.js 22.15 or newer and git on both machines. Session format v4. MIT licensed; the source is one directory in the Skills repository.

Install it with one prompt

A command line tool that writes inside ~/.dsh. Before installing, know what it touches: the header cwd, attachments, and the workspace index.

Paste this into DSH, or send it to a colleague:

Install Handoff on this machine and verify it: https://www.dshtoolbox.com/tools/handoff/
1. Check this machine has Node.js 22.15 or newer, and git
2. Install the command line: `npm i -g @mrwilliam/dsh-handoff`
3. Tell it which machine this is: `dsh-handoff config --device <this machine> --mailbox <mailbox repo path> --port <local DSH port> --restart manual`
4. Add the path mapping: the other machine folder onto a local one (absolute paths; a backslash in JSON is written twice)
5. Run `dsh-handoff status` and confirm it lists the local sessions with zero inconsistent paths
Paste back the `status` output and the `config` result. If a step fails, stop and paste the error instead of adding flags to get past it. To upgrade later: `npm i -g @mrwilliam/dsh-handoff@latest`, then run status again.