# Moving one DeepSeek Harness session to another machine without breaking it

> Source: <https://dev.to/mrwilliam_9596/moving-one-deepseek-harness-session-to-another-machine-without-breaking-it-gc8>
> Published: 2026-11-27 22:30:00+00:00

**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 the playbook "Running AI in production": <https://wpnews.pro/playbooks/production-ops>

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](https://www.dshtoolbox.com/tools/handoff/), it is MIT, and it moves the session plus the attachments it references.

`cwd` rewritten — body frames are copied byte for byte`attachments/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](https://github.com/FindSomeSkills/Skills/tree/main/dsh-tools/dsh-handoff)
