personal sync

Agent backup and restore

Protect and restore Claude Code and Codex sessions, memory, and safe setup without copying credentials or overwriting divergent history.

Updated

Preview status: this workflow exists in the current development working tree but has not been published as a Docmancer release. Managed snapshots require the pending database migration and acceptance testing before production use.

Your coding agents remember what happened on one machine. Docmancer securely restores their sessions, memory, and setup, then makes the useful project context available to every agent you use.

Backup and Shared Memory solve different parts of that journey. Backup keeps the original Claude Code and Codex history recoverable. Consolidation finds durable decisions inside that history and turns them into source-attributed proposals. Nothing becomes Shared Memory until you review it.

Preview the backup

Start with a read-only inventory:

docmancer backup --dry-run

The preview reports protected agents, projects, categories, logical bytes, adapter and vendor versions, and excluded artifacts. Use --project, --exclude-project, or --agent to narrow the snapshot. Attachments are omitted unless you pass --include-attachments. When a project filter is active, mixed-project global prompt histories and the mixed Claude project registry are withheld rather than risking content from an excluded project.

Docmancer protects supported sessions, prompt history, memory, instructions, rules, skills, hooks, safe settings, MCP server definitions, and project identity. It excludes authentication stores, credentials, .env files, literal MCP environment values, machine keys, caches, logs, shell snapshots, and telemetry.

Create a free local archive

docmancer backup --local --to ~/Backups/agents.dmbak

The command asks for a passphrase and creates one .dmbak file. The archive uses Argon2id for passphrase derivation, XChaCha20-Poly1305 for authenticated encryption, transcript-stable chunks, and independently compressed Zstandard chunks selected by a versioned dictionary identifier.

The same command uses managed Cloud storage when Personal Sync is connected and entitled. Pass --local whenever you want a local archive instead.

Restore a local archive

Close Claude Code and Codex, then preview the restore:

docmancer restore ~/Backups/agents.dmbak --dry-run

Map a source project when its repository lives at a different path:

docmancer restore ~/Backups/agents.dmbak \
  --map /old/path/to/project=/new/path/to/project

Docmancer authenticates the encrypted manifest and verifies every chunk before planning writes. It rewrites only recognised structured project-path fields. It does not search and replace old paths inside prompts, commands, tool results, or other historical text.

The restore creates missing files, skips identical files, and merges safe JSON and TOML configuration with destination values taking precedence. A divergent session with the same destination is written to the Docmancer conflict quarantine. It is never selected as the winner or overwritten silently.

Restore from Personal Sync

Connect and approve the new machine first:

docmancer cloud connect
docmancer restore --source-device DEVICE_ID --dry-run
docmancer restore --source-device DEVICE_ID

Cloud retains the latest valid snapshot from each approved source device. One new machine therefore cannot replace another machine's only snapshot. A replacement that drops artifact count or logical bytes by more than 20 percent is refused unless you inspect the change and pass --allow-large-removal during backup.

The hosted service stores opaque workspace references, signed encrypted descriptors, encrypted manifests, and encrypted chunks. It cannot read local paths or agent history. The initial managed limit is 1 GB of unique retained ciphertext per personal workspace.

Review recovered project memory

Backup and restore run the local deterministic consolidation pass. Review any proposal before applying it:

docmancer consolidate
docmancer consolidate --review PROPOSAL_ID
docmancer consolidate --approve PROPOSAL_ID

Every proposal links to exact session evidence. Rejected evidence is remembered locally and is not proposed again unless its source changes. The default path makes no provider call.

Rotate encryption keys

Workspace-key rotation is deliberately blocked once encrypted history exists. The current implementation cannot yet distribute every historical key to a replacement device, so allowing rotation would make older snapshots or Shared Memory envelopes unrecoverable.

docmancer cloud rotate-key

The command refuses the operation when snapshots or encrypted Shared Memory history exist. Historical-key migration must be implemented and accepted before this restriction is removed. docmancer status reports any source snapshots using another key version, but that counter is diagnostic and does not perform migration.

Diagnose a machine

docmancer status
docmancer doctor

Status reports Cloud source-device snapshots and pending key migration. Doctor checks the Claude Code and Codex backup adapters, inventory size, exclusions, Cloud quota, and snapshot health without exposing secret values.