I write in DSH on a desktop and then open the laptop, and the laptop has none of it. Same account, same harness, empty session list.
Copying ~/.dsh between machines is the obvious fix and it is a bad one. The sessions are fine — they are session*.jsonl.zstd, append-only, safe to copy when nothing is writing. The index is not fine. workspace.json and session_projcache.json are rewritten by both machines, and a whole-file copy means whichever one lands last deletes the other's sessions from the list. That is how you lose work without deleting anything.
So I built DSH Sync Hub. It is a small server plus an agent, both plain Node, no dependencies.
What it moves, and what it refuses to understand
Sessions go through as opaque bytes: hash, split into fixed chunks, ship the missing ones. The code never parses zstd or JSONL. That is deliberate — if the session format changes next month, the transport still works.
The two index files are handled differently: they are merged semantically, per workspace and per cache entry, because chunking them would just spread the overwrite problem around.
Incremental transfer compares whole-chunk prefixes only. The trailing partial chunk changes on every append, so it is excluded from the comparison. In one measured append of 10 KB, 28,928 bytes moved instead of about 160 KB — 81.9% saved. Not a benchmark, one run on my machine.
Six commands
Clone, start the hub on the machine that holds the sessions, pair the other one, sync.
The same commands sit on a page where each block has a one-click copy button, if selecting text here is annoying: https://www.dshtoolbox.com/guides/sync-dsh-sessions/
git clone https://github.com/FindSomeSkills/Skills.git dsh-skills
cd dsh-skills/dsh-tools/dsh-sync-hub
node src/hub/server.mjs
# 7788 by default
node src/agent/cli.mjs code \
--hub http://127.0.0.1:7788
On the laptop:
node src/agent/cli.mjs pair \
--hub http://<desktop>:7788 \
--code <code> --name my-laptop
node src/agent/cli.mjs sync \
--hub http://<desktop>:7788 \
--home ~/.dsh
Node 20 or newer. Nothing to install, nothing to sign up for, and the hub keeps its data in ./.dshsync-hub next to the repo.
When both sides changed
The hub writes a conflict copy and leaves the local file alone. No merge dialog, no silent winner. You look at two files and decide.
Credentials never get uploaded: .credentials*, *.pem, *.key, id_rsa and anything under profiles/**/cred* are rejected by name before a chunk is read.
What is not done
No web console. No PWA. No version history with one-click restore. No live push over SSE — sync runs when you run it. The sync path itself works end to end: pair, first transfer, pull, incremental, conflict, all covered by four end-to-end tests.
I would rather say that now than have someone discover it after pointing it at their only copy.
If you would rather not type it
Paste this into DSH and let it run the steps (the copy button version is on the same page as above):
帮我把 DSH Sync Hub 跑起来,按顺序做,哪一步失败就停下把原文报给我:
1. git clone https://github.com/FindSomeSkills/Skills.git dsh-skills
2. cd dsh-skills/dsh-tools/dsh-sync-hub
3. node src/hub/server.mjs (记下监听的地址,默认 7788)
4. 生成一次性配对码:
node src/agent/cli.mjs code --hub http://127.0.0.1:7788
5. 另一台设备配对:
node src/agent/cli.mjs pair \
--hub http://<第一台地址>:7788 \
--code <码> --name <设备名>
6. 同步:
node src/agent/cli.mjs sync \
--hub http://<第一台地址>:7788 \
--home ~/.dsh
先把第 3 步的输出和第 4 步的码贴给我,再继续。不要改 ~/.dsh 里的任何文件。
Source and docs: https://github.com/FindSomeSkills/Skills/tree/main/dsh-tools/dsh-sync-hub
A longer walkthrough, including what each step does and how updating works: https://www.dshtoolbox.com/guides/sync-dsh-sessions/
If you try it and the first sync hangs on pairing, tell me what code printed and what the hub logged. That part is the least battle-tested.
Top comments (0)