cd /news/ai-tools/moving-one-deepseek-harness-session-… · home › topics › ai-tools › article
[ARTICLE · art-177505] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Moving one DeepSeek Harness session to another machine without breaking it

A developer built Handoff, an MIT-licensed CLI that moves a DeepSeek Harness (DSH) session file between machines by rewriting the absolute cwd recorded in the session's first frame, from which DSH derives both the session's folder location and its workspace entry. The tool copies referenced attachments deduplicated by sha256, updates workspace.json first, and handles divergent copies with a byte-prefix test rather than timestamps, writing non-matching incoming files alongside the existing session. The developer reports two bugs found only on the receiving machine — an apply path that read its mapping from a flag instead of the config file, and a status check that trusted a stale session.lock — both now covered by exit-code recording and an lsof probe.

recommendation

When moving agent session state between machines, rewrite the recorded working directory and verify the receiving side's config path and lock checks, since both bugs here only reproduced on the destination machine.

more in playbook: Running AI in production
by read2 min views4 publishedNov 27, 2026

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.

cwd rewritten — body frames are copied byte for byteattachments/v1/, deduplicated by sha256 workspace.json first What does not move: credentials, profiles, skills, scheduled tasks, and any file the session did not reference.

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.

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.

apply read the path mapping from a flag instead of the config file. The auto-receive path passes only --home and --yes, so the mapping was empty and every macOS-to-Windows transfer died with "no matching entry".status=ok because 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.

.receipt-<device>.json) that travels back through the mailbox, so the sender sees "received by …" in its own list

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.

Source and changelog: github.com/FindSomeSkills/Skills

── more in #ai-tools 4 stories · sorted by recency
── more on @deepseek harness 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/moving-one-deepseek-…] indexed:0 read:2min 2026-11-27 · —