Keeping agent history in sync across machines

two machines, one person, one history

Two machines, one person, and no way to sync between machines. The fix you worked out on the laptop is on the laptop, and the desktop's agent has never heard of it. Neither has the work laptop you use three days a week.

What moves, and how

deja sync ssh desktop           # push what this machine has learned
deja sync ssh desktop --pull    # take what that one has
deja sync ssh desktop --both    # both directions in one command
deja sync                       # every machine deja already knows, both ways

The transport is your own SSH: deja exports a batch, copies it with scp, and runs deja sync import on the other side, which is why the remote needs deja installed and reachable the way you already reach it. No account, no service, nothing in the middle. The first exchange with a host records it as a peer, so deja sync afterwards knows who to talk to.

Transfers are incremental and append-only: each side keeps a watermark and sends what the other has not seen. --full resends everything, which is the recovery path when a batch was lost — the error message says so at the moment it happens rather than leaving you to guess.

What arrives

Indexed sessions, not the harness's raw files. The receiving machine can search them, and a hit carries the machine it came from, so "we fixed this on the laptop in July" stays a fact you can see rather than one you have to remember. Redaction is re-applied on export, so what crosses the wire has been through the masking rules twice.

Deciding what synced memory may do

Memory from another machine is not automatically as trusted as memory from this one — a work laptop's history in a personal session, or the reverse, is a real concern. The trust policy at ~/.config/deja/policy.json separates the paths memory can activate on: search, mcp and auto. Synced sessions stay searchable but never inject themselves:

{"activations": {"auto": {"imported": false}}}

The same rule can name a single peer (imported:work) rather than all imports. Receipts and deja log --last name the policy that allowed each injection, so what reached the model is inspectable after the fact rather than a matter of trust.

Keeping it current

deja install sync-timer runs the exchange on a schedule, and deja doctor reports each peer with when it last synced — a peer that has quietly stopped is the failure mode worth catching, because everything keeps working and simply stops being shared.

What this is not

It is not a team feature. There is no server, no shared account and no access control beyond the SSH you already have — it moves one person's history between one person's machines. Sharing a single session with somebody else is a different job, and deja share does that one.

Exporting sessions · Privacy and trust scopes · CLI reference